There are three possibilities for communicating with the SQC-122. The first is a DOSbased terminal program. The next is a 32 bit Windows DLL. The third is a Windows
program that can configure and operate the SQC-122.
SQM-TERM.EXE
This simple DOS-based terminal program allows you to send a command and receive a
response via the computer’s RS-232 port. The computer’s COM1 port baud rate must
be set to match the SQC-122 before the program is run. Source code (SQM-TERM.C)
is provided, so it can be customized easily. The command and response strings are
detailed in the attached Communications Protocol.
SIGMACOM.DLL
This 32 bit DLL should be placed in your Windows System directory. No Windows
registration is needed. The first call should be to InitCom to establish the comm port and
baud rate. Functions and their calling convention are listed in the attached
SIGMACOM.DLL Functions document.
SQC-122.EXE
This program uses SIGMACOM.DLL to communicate with the SQC-122. It must be
installed in Windows using the Setup SQC-122 installation program. It allows you to set
film parameters and names, download them to the SQC-122, and perform front panel
functions. This program is written in Visual Basic, contact Sigma Instruments if you need
the source code for this program.
The SQC-122 communicates with a host computer via an ASCII based protocol. The
instrument defaults to 19200 baud, 8 data bits, and no parity. The baud rate can be
changed in the System Menu of the SQC-122, but is always 8 data bits with no parity.
The basic protocol is:
<sync character> <length character> <1 to n data characters> <CRC1><CRC2>
Once a valid command has been transmitted to the SQC-122, a response is returned.
The structure of the packet is identical in both the command and response. In the
response, the first character is a Response Status. These are summarized in the
following table.
Response LetterMeaning
ACommand understood, normal response
BCommand understood, but instrument reset
CInvalid command
DProblem with data in command
EInstrument in wrong mode for this command
The sync character is an exclamation point ‘!’. Anytime this character is received, the
communications for that packet is reset. Following the sync character is the length
character. This is the number of characters in the packet starting with the length and
counting the 2 CRC characters. This character has a decimal 34 added to it so there
cannot accidentally be a sync character embedded in the packet. The two character
CRC is computed using the following algorithm:
1. The CRC is initialized to 3FFF hex.
2. Each character in the message is examined, bit by bit, and added to the CRC
in the following manner:
a) The character is exclusive or’d with the CRC.
b) The CRC is shifted right one bit position.
c) If the character’s least significant bit is a 0 then the CRC is exclusive or’d
with 2001 hex.
d) Steps b and c are repeated for each of the 8 bits in the character.
The CRC contains 14 significant bits. This is split into two characters of 7 bits each, and
then a decimal 34 is added to offset the character outside the range of the Sync
Command:U
Parameters: 0 to 33
Description:Controls operation of the SQC-122.
0 = Start Process6 = Start Process 1
1 = Stop Process7 = Start Process 2
2 = Start Layer8-30 = Start Process 3-25
3 = Stop Layer31 = Soak Hold
4 = Start Next Layer32 = Zero Thickness
5 = Force Final Thickness33 = Zero Time
Example:U1AStarts the first layer of the active process.
Command:V
Parameters: None
Description:Controls operation of the SQC-122.
This dll acts as an interpreter between an application and the SQC122. The dll
transforms function calls to specific command sequences that the unit understands.
Transfer of data to the unit, in general, requires two function calls. The first
function call is to transfer the data to the unit. The data to be sent is usually contained in
the function’s parameter(s). The second function call is to ChkCommDone. This function
call ensures that the data was sent properly to the unit.
Data retrieval requires three function calls. The first function call is used to tell the
unit what data is being requested. The second function call is to ChkCommDone. This
function call is used to determine when all of the data has been transferred from the unit
to the dll or if an error occurred in the communications. The third function call is used to
retrieve the data from the dll.
InitComm
Parameters: 16 Bit Integer, 32 Bit Integer
Return : 16 Bit Integer.
InitComm is used to initialize the dll com port. The function’s first parameter is the
com port number to initialize (1 - 99 are valid). The second parameter is the baud
rate for the port. The function returns zero if initialization was successful or a bit
flag to indicate the failure of the initialization :
Example:
bit 0 : Communications Port handle is invalid.
bit 1 : Communications Port Set parameters invalid (Baud Rate)
bit 2 : Communications Port Set timeouts invalid.
bit 3 : Communications Port Set mask invalid.
bit 4 : Communications Port Error – Already exists.
bit 5 : Communications Port Set Read Thread fail.
bit 6 : Communications Port Set Read Thread priority fail.
ReturnVal =InitComm(1,19200)initialize Com1 to 19200 baud
if (ReturnVal != 0)if port did not initialize correctly
CloseComm()close the port
Loading...
+ 14 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.