Section 5
Page 5 - 50
HA243821
Issue 5 Mar 98
MODEL 346 INSTALLATION AND OPERATION MANUAL
5.7.9 ‘C’ PROGRAM
The following program, written in ‘C’, uses the EI Bisynch protocol to communicate with the recorder. The main
program (MAIN) calls the following routines:
1. Init port. Sets the communications Baud rate (9600 Baud), seven data bits, one stop bit and even parity.
2. Send byte. Send a single character to the communications port.
3. Get byte. Receives a single character from the communications port.
4. Get byte filt. Receives a single character from the communications port, allowing for a latency delay.
5. Send address. Sends EOT GGUU to the communications port.
6. Select cmd. Sends STX, channel address and command mnemonic to the communications port.
7. Get reply. Waits for a message to be returned from the instrument.
8. Poll value. Reads the value of the parameter polled
USING THE PROGRAM
When the program starts running, the message:
Enter group and unit address (no spaces) e.g. 2211 :
appears, requesting the group and unit IDs (see section 5.7.3) for the recorder to be accessed. Entry of the
appropriate address, followed by a carriage return causes the following message to appear:
Enter channel number 1 to {:
Entry of the appropriate CN (table 5.7.5a) for the required parameter, followed by a carriage return, causes the
message:
E
nter command and data (no spaces) e.g.PV12.345 or Q to qui
t: to appear.
To read the current value of the relevant mnemonic, the mnemonic should be entered, followed by a carriage
return. The response will be a message containing the channel number, parameter mnemonic and the current
value.
To write a new value to a parameter, its mnemonic should be entered, followed immediately (i.e. without any
spaces) by the value to be written, followed by a carriage return. The response will be the message:
Acknowledged.
In either case, the response is followed by the
Enter channel number 1 to {:
message.
In order to leave the program, or to address a further recorder, Q (or q) should be entered in response to the
Enter command and data e.g.PV+12.345 or Q to quit: message.
Note...
The + sign may be omitted, but if so, a space character MUST precede the value to be written.
® IBM is a registered trademark of the International Business Machines Corporation