3 example response: set process update failed, 7 checksum calculation – INFICON SQM-242 Thin Film Deposition Controller Card Software Operating Manual User Manual

Page 78

Advertising
background image

5 - 4

IP

N 07

4-

55

1-

P1

A

SQS-242 Operating Manual

5.6.2.3 Example Response: Set Process Update Failed

@UP;<NAK>;<ERR>;??<CR>
Where:
01

Illegal Command

02

Illegal Parameter

03

Illegal Format

04

Checksum Error

05

Request Denied

06

Unknown Error

5.7 Checksum Calculation

The sample code below calculates the FCS checksum of a string of characters.

In the code, Message is a string that has been stripped of terminator and checksum
characters before being passed to this routine.

' XOR ASCII codes
For i = 1 To Len(Message)
FCS = Asc(Mid$(Message, i, 1)) Xor FCS
Next i

' Convert FCS to two character hex string
If Len(Hex$(FCS)) = 1 Then
CalcChkSum = "0" & Hex$(FCS)
Else
CalcChkSum = Hex$(FCS)

NOTE: While checksums “may” be useful for RS-232 communications, they are

not needed for Ethernet or ActiveX. If you don’t want to use a checksum,
replace the checksum in each command with “00” (two ASCII zero (Hex
30) characters). The program response will contain two checksum
characters, which you can just ignore.

Advertising