You are on page 1of 13

Thar Instrument

Interfacing

MN029
Rev 0

MN29 1
Rev 0
1. Forward
1.1. Copyright Statement
The User Of This Manual Shall Hold Thar Technologies, Inc And Their Suppliers Harmless Of Any And
All Costs And Expenses, Including Legal Fees, They Or Anyone Else May Allege Were Caused By The
Use Of This Manual(S).

1997 THAR TECHNOLOGIES Inc. All Rights Reserved. Printed In The United States Of America.
Except As Permitted Under The United States Copyright Act Of 1976, No Part Of This Publication May
Be Reproduced Or Distributed In Any Form Or By Any Means, Or Stored In A Database Or Retrieval
System, Without The Prior Written Permission Of Thar Technologies Corporation.

1.2. Disclaimer
The user of this manual shall hold Thar Technologies and their suppliers harmless of any and all costs and expenses,
including legal fees, they or anyone else may allege were caused by the use of this manual(s).

The information contained in this document has been reviewed and, to the best of our knowledge, is accurate at the time
of writing. Thar Technologies assumes no responsibility for the use of this information.

1.3. Inquiry
Please direct all inquiries to your representative or to the corporate office address:
Thar Technologies, Inc
100 Beta Drive
Pittsburgh, PA 15238 USA
info@thartech.com
The corporate office HOT LINE service is available during normal working hours of 8:00 AM to 4:30 PM, Eastern
Standard Time:
Tel: (412) 967-5665
Fax: (412) 967-9446
Thar Technologies users have the advantage of Applications and customer support from our knowledgeable staff.

1.4. Component Commands

This document lists the instructions that can be sent to Thar Technologies, Inc. system components via RS232. The
commands are one-byte (unsigned) commands, which means they can be any value from 0 to 255 decimal. If a
command requires that data be sent with it, the format of that data will be listed in the Data column in order. Please
note that 80x86 microprocessors address memory in Little-Endian fashion (or LSB to MSB) while the SA Systems
chips address memory in Big-Endian fashion (or MSB to LSB). Adjust outgoing data accordingly.

MN29 1
Rev 0
2. PUMP Control

2.1. PC Commands to the pump

Command Data Description


11/0BH None Stops the pump.

12/0CH None Starts the pump.

14/0EH 2-byte integer Runs pump at control point designated by Data. Start command
should be sent first.

15/0FH None Clear / Zero the alarm.

16/10H None No longer supported.

18/12H None Ping.

20/14H 2-byte integer, 1-byte integer, Tells the pump to start sending data to the pc.
2-byte integer. The first integer is the rate in ms at which to update the pc with
data. The second integer should be set to 1, and the third integer
is the rate in ms at which to update the pc with status info.

21/15H None Tells the pump to stop sending data to the pc.

100/64H None No longer supported.

102/66H 2-byte integer Sets the alarm value of the pump to the value specified by the
accompanying 2-byte integer.

103/67H 2-byte integer, 2-byte Sets the pump parameters. The pumps control point is set to
integer, 1-byte integer the value of the first 2-byte integer, the final three bytes should be
set to 0.

104/68H 6 1-byte integers, 2-byte integer, Sets the profile information in the pump. The first 6
2-byte integer, 2-byte integer, bytes are the ascii values for the name. The next 2
2-byte integer, 2-byte integer, are used for the Kp value. The next 2 for the Ki, and
1-byte integer, 2-byte integer, the next two for the Kd. The next 2 bytes are for the
1-byte integer, 2-byte integer Maximum Summation Error. The 2 after that represent the Sensor
Threshold. Then a single byte to indicate the Sensor ID. Then
another 2-byte integer for the Attenuation factor. Then a 1-byte
integer indicating the digital to analog channel (this number
should Always be zero). And the last 2-byte integer is the
Equation factor.

105/69H 2-byte integer Set the voltage of the motor. 2-byte integer indicates new voltage
(0-5000).

2.1.1. Pump Command Examples


Start Data:

MN29 2
Rev 0
0E F1 01 00 4D 10 00 00 01 00 14 03 E8 01 0B B8 22
Pump requested to send data every 1000mS, status every
3000mS
Ping Command:
09 F6 01 00 4D 10 00 00 01 00 12 71
The pump requires a ping command be sent within the
interval specified in the pump setups. If the ping
command is not received within this time the pump will
stop
Set Parameters Command:
0E F1 01 00 4D 10 00 00 01 00 67 00 32 00 00 01 F9
The pump is set to run at 50 gms/min in the flow mode.

2.2. Return Data from the pump Command 65


Assigned ID 1 byte integer
Pressure 2 byte integer
Flow 2 byte integer
Voltage 2 byte integer
Time, hr. 2 byte integer
Time, min. 2 byte integer
Time, sec. 2 byte integer
Time, ms. 2 byte integer
Not Used 2 byte integer
Alarms 1 byte integer - bit 1 = Analog Input High Alarm
bit 2 = Analog Input Low Alarm
bit 3 = Digital Input High Alarm
bit 4 = Digital Input Low Alarm
bit 5 = 6805 Program Error
bit 6 = 6805 Data Error
bit 7 = Communication Error
bit 8 = Unspecified Error
Alarm ID 1 byte integer
RPM 2 byte integer

2.2.1. Pump Data Examples


Pump Data:
| Header and command |ID|Prs |Flow |Volt |Hour |Min |Sec |mS |Open |Am|ID |RPM |CS
1E E1 01 00 0B 20 07 00 00 00 65 00 00 01 00 00 00 00 01 8C 00 1F 00 06 03 74 00 00 00 00 00 00 C2
Pump Status:
| Header and command | |CS
0B F4 01 00 0B 20 07 00 00 00 16 0E 00 57

2.3. Return Data from the pump Command 16


Errors 1 byte integer - bit 1 = Error
bit 2 = Running
bit 3 = Control
bit 4 = Run
bit 5 = Alarm
bit 6 = 6805 Failure
bit 7 = Unspecified
bit 8 = Unspecified
Errors2 1 byte integer - bit 1 = Actuator Failure no longer supported
bit 2 = EEPROM Error

MN29 3
Rev 0
bit 3 = Power Off Safe
bit 4 = Unspecified
bit 5 = Unspecified
bit 6 = Unspecified
bit 7 = Unspecified
bit 8 = Unspecified

MN29 4
Rev 0
3. BPR Control

3.1. PC Commands to the Old Style BPR

Command Data Description


10/0AH None No longer supported.

11/0BH None Stops the BPR.

12/0CH None Starts the BPR.

14/0EH 2-byte integer Runs BPR at pressure designated by Data. Start command should
be sent first.

15/0FH None Clear / Zero the alarm.

17/11H 2-byte integer Sets the temperature to the value indicated by the
2-byte integer.

18/12H No longer supported.

20/14H 2-byte integer, 1-byte integer, Tells the BPR to start sending data to the pc.
2-byte integer. The first integer is the rate in ms at which to update the pc with
data. The second integer is not used, and the third integer is the
rate in ms at which to update the pc with status info.

21/15H None Tells the BPR to stop sending data to the pc.

120/78H None No longer supported.

122/7AH 2-byte integer, 1-byte integer Sets the Alarm. The first 2-byte integer indicates the pressure at
which the alarm should begin. The Second, 1-byte, integer no
longer supported.

123/7BH 2-byte integer, 2-byte integer Sets the pressure and the temperature of the BPR. The first 2
bytes represent the pressure and the last 2 bytes represent the
temperature.

124/7CH 8 1-byte integers, Sets the Profile information in the BPR. The first
2-byte integer, 2-byte integer 8 bytes are ascii values for the name. The next 2
2-byte integer, 2-byte integer bytes represent Kp. Then 2 for the Ki and 2 more
1-byte integer, 2-byte integer for the Kd. The next 2 bytes indicate the maximum allowable
error or deviance. Then a 1-byte integer to indicate sensor ID,
and the last 2-byte integer is the Attenuation Factor.

125/7DH 2-byte integer Sets the BPR needle position to the point specified by the
accompanying 2-byte integer.

MN29 5
Rev 0
3.1.1. Old Style BPR Command Examples
Move Needle:
| Header and command |Pst |CS
0B F4 02 00 4D 20 00 00 01 00 7D 00 64 51
Moves needle to position 100

3.2. PC Commands to the New Style BPR


NOTE: all commands sent via TNET protocol.
11 (START)
12 (STOP)
14 (RUN_AT)
17 (RUN_HEATER)
18 (PING)
19 (STOP_HEATER)
20 (DATA_START)
21 (DATA_STOP)
122 (SET_ALARM)
123 (SET_PARAM)
124 (SET_PROFILE)
125 (GOTO_POSITION)
254 (PASS_THROUGH)

Command Data Description

11/0BH None This command starts the automated pressure control.

12/0CH None This command stops the automated pressure control.

14/0DH 2 byte integer This command sets the BPRs pressure control setpoint to the
accompanying 2-byte signed integer and starts the automated
pressure control.

17/11H None This command starts the external heater.

19/13H None This command stops the external heater.

20/14H 2 data byte integer The 2 data bytes represent an update rate in ms. The return data is
layed out as a 2 byte unsigned integer representing the current
needle position, a 2 byte signed integer representing the current
pressure, a 2 byte signed integer representing the valve
temperature, a 2 byte signed integer representing the ext. heater
temperature, and a 1 byte bitwise sequence representing the bprs
current status where:
bit 1 = 1 then bpr is controlling.
bit 2 = 1 then bpr is under alarm condition.
bit 3 = 1 then the valve heater is on.
bit 4 = 1 then the Ext. heater is on.
bits 5-8 are not currently used.
This command tells the bpr to begin updating the PC with
information at a rate specified by the accompanying 2 byte ms

MN29 6
Rev 0
value. The bpr will respond by sending data in the return data
format described above at the specified rate.

21/15H None This command tells the bpr to stop sending data to the PC.

121/79H None Data return from BPR, not valid command to the BPR

122/7AH 3 byte integers The first byte represents the alarm to change (0 = pressure, 1 =
valve heater (Not Implemented), 2 = Ext. Heater), and the next 2
data bytes represent the alarm value as a signed integer. This
command sets the alarm of the specified sensor to the value
represented by the 2 data bytes.

123/7BH 3 bye integers The first byte represents the setpoint to change (0 = pressure, 1 =
valve heater, 2 = Ext. Heater), and the next 2 bytes represent the
setpoint as a 2-byte signed integer. This command sets the
specified setpoint to the value represented by the 2 data bytes.

124/7CH 16 data integers The first eight data bytes represent a zero terminated string
naming the profile. The next 2 data bytes represent the
Proportional Band value as a signed integer (Max 300). The next
2 data bytes represent the Integral Time value as a signed integer
(Max 1000). The next 2 data bytes represent the Derivitive Time
value as a signed integer (Max 1000). The next 2 data bytes
represent the Maximum allowed output as a signed integer (Max
6000). This command sets the current control algorithm value to
the values passed as data bytes as described above.

125/7DH 2 byte integers The 2 data bytes represent the needle position the bpr should
move too as an unsigned integer. This command tells the bpr to
move to an absolute needle position. It is ignored if the bpr is
currently controlling the pressure.

254/FEH None This command puts the bpr in Pass Throughmode, which allows
com port traffic to pass between the 6805 software and the
external serial port as if they were directly connected. A restart is
needed to exit this mode.

3.2.1. New Style BPR Command Examples

Set Alarm Pressure:


0C F3 02 00 4D 20 00 00 01 00 7A 00 01 F4 DF
Sets the pressure alarm to 500

MN29 7
Rev 0
3.3. Return Data from the BPR (Old Style)
Assigned ID 1 byte integer
Valve Position 2 byte integer
Pressure 2 byte integer
Temperature 2 byte integer
Time, hr. 2 byte integer
Time, min. 2 byte integer
Time, sec. 2 byte integer
Time, ms. 2 byte integer
Not Used 2 byte integer
Alarms 1 byte integer - bit 1 = Analog Input High Alarm
bit 2 = Analog Input Low Alarm
bit 3 = Digital Input High Alarm
bit 4 = Digital Input Low Alarm
bit 5 = 6805 Program Error
bit 6 = 6805 Data Error
bit 7 = Communication Error
bit 8 = Unspecified Error
Alarm ID 1 byte integer

3.3.1. Old Style BPR Data Examples


BPR Data:
| Header and command |ID|Pstn |Pres |Temp |Hour |Min |Sec |mS |Open |Al|AI|CS
1C E3 02 00 0C 20 07 00 00 00 79 01 02 BD 00 38 00 0A 00 00 00 01 00 03 03 2B 00 00 00 00 E2

3.4. Return Data from the BPR (New Style)

Valve Position 2 byte integer


Pressure 2 byte integer
Valve Temp 2 byte integer
Ext Temp 2 byte integer
Status 1 byte integer - bit 1: 1 = Control n
bit 2: 1 = Alarm on
bit 3: 1 = Valve heat on
bit 4: 1 = External heat control on
bit 5: Not defined
bit 6: Not defined
bit 7: Not defined
bit 8: Not defined

3.4.1. New Style BPR Data Examples


BPR Data:
| Header and command |Pstn |Pres |VlvT |Ext T|St|CS
12 ED 02 00 0C 20 07 00 00 00 79 03 A8 00 1F 00 30 01 3D 04 EA

MN29 8
Rev 0
4. GENSYS COMMANDS

4.1. PC Commands to the Gensys

Command Data Description


11/0BH None Stops the GenSys.

12/0CH None No longer supported.

14/0EH 1-byte integer, 1-byte integer Sets GenSys options. The first byte is the
1-byte integer temperature. The second is the actuator position, and the third is
not used.

20/14H 2-byte integer, 1-byte integer, Tells GenSys to start sending data to the pc.
2-byte integer. The first integer is the rate in ms at which to update the pc with
data. The second integer is not used, and the third integer is the
rate in ms at which to update the pc with status info.

21/15H None Tells GenSys to stop sending data to the pc.

212/D4H 2-byte integer, 1-byte integer Sets the parameters for GenSys. The first 2 bytes
1-byte integer, 2-byte integer represent the temperature. The byte after that is the
1-byte integer, 2-byte integer Actuator position and the byte after that is the Actuator number.
The next 2 bytes indicate the Universal Board number, followed
by a 1 byte digital To analog channel number, and the last 2 bytes
Indicate the voltage set point.

4.2. Return Data from the Gensys


GenSys
Assigned ID 1 byte integer
8 Analog Inputs 2 byte integer for each
12 Actuator Positions
1 byte integer for each
Digital Port 1 byte integer
Not Used 1 byte integer
Time, hr. 2 byte integer
Time, min. 2 byte integer
Time, sec. 2 byte integer
Time, ms. 2 byte integer

MN29 9
Rev 0
5. Collection Unit Commands

5.1. PC Commands to the Collection Unit

Command Data Description


10/0AH 1-byte integer Sets the number of collection vessels used in the process.

12/0CH 1-byte integer, 2-byte integer Used to set the monitoring delay for vessel activation. The first
byte represents the vessel and the next two represent the delay in
milliseconds. The monitoring delay is the amount of time in
seconds that must elapse between the deactivation of previous
vessel and activation of current vessel. If the current vessel is the
first vessel, then it is the time between starting the collection
process and activation of the current vessel. The first byte
represents the vessel and the second represents the delay in
seconds.

17/11H 1-byte integer, 2-byte integer Used to set the monitoring delay for vessel de-activation. The
first byte represents the vessel and the next two represent the
delay in milliseconds. The monitoring delay is the amount of time
in seconds that must elapse between the activation of current
vessel and the deactivation of the current vessel. The first byte
represents the vessel and the second represents the delay in
seconds.

20/14H 1-byte integer, 2-byte integer Used to set the activation point for a vessel. The activation point
is the UV reading at which the vessel will start collecting. The
first byte represents the vessel and the next two represent the
activation point.

30/1EH 1-byte integer, 2-byte integer Used to set the deactivation point for a vessel. The deactivation
point is the UV reading at which the vessel will stop collecting.
The first byte represents the vessel and the next two represent the
deactivation point.

40/28H 1-byte integer, 2-byte integer Used to set the activation delay for a vessel. The first byte
represents the vessel and the next two represent the delay in
milliseconds. The activation delay sets the amount of time
between the collector reaching the activation point and the
solenoid is energized. Used to accommodate lag time between the
UV and the vessel.

50/32H 1-byte integer, 2-byte integer Used to set the deactivation delay for a vessel. The first byte
represents the vessel and the next two represent the delay in
milliseconds. The de-activation delay sets the amount of time
between the collector reaching the activation point and the
solenoid is de-energized. Used to accommodate lag time between
the UV and the vessel.

60/3CH None Used to start the collection process. If any vessels are currently
collecting, they will be closed before the process begins.

70/46H None Used to stop the collection process.

MN29 10
Rev 0
80/50H 2-byte integer Tells unit to begin sending data to the PC at the specified rate.
The 2-byte integer represents the rate in milliseconds.

90/5AH 1-byte integer Activate specified vessel. The 1-byte integer represents the vessel
to activate.

100/64H 1-byte integer Deactivate specified vessel. The 1-byte integer represents the
vessel to deactivate.

110/6EH None Reset.

120/78H None Set unit to Pass Through Mode causing all commands from the
PC to be sent directly to the 6805 program and all info passed
from the 6805 to be sent directly to the PC.

255/FFH None Used to exit Pass Through Mode.

5.2. Return Data from the Collection Unit


UV Reading 2 byte integer
Active Vessel/Collection On
1 byte integer - bit 1 = Collection on if set to 1
bits 2 - 8 = Active Vessel (0= none)
3 Activation Monitoring Delays
2 byte integer for each
3 Deactivation Monitoring Delays
2 byte integer for each
3 Activation Delays
2 byte integer for each
3 Activation Points
2 byte integer for each
3 Deactivation Delays
2 byte integer for each
3 Deactivation Points
2 byte integer for each
Number of Vessels
1 byte integer (maximum of three vessels allowed)
PC Update Rate 2 byte integer (milliseconds)

MN29 11
Rev 0
6. The Tnet Protocol.
All of the previously listed commands are sent using the Tnet Protocol. Below is a description of a packet sent using
the Tnet protocol from a PC.

First comes the header:


1 byte representing the length of the packet. The length of the packet is the length of the header (9) plusthe length of
the data sent with the command. NOTE: the command and checksum bytes are not counted in the length.

1 byte representing the 1s compliment of the length byte. This is used when received to check integrity.

1 byte representing the port number.

1 byte representing the address. This should always be set to zero.

1 byte representing the port number of the sender. When sending from the PC, this number should be 77.

1 byte representing the address of the sender. This should always be zero.

1 byte representing the device type. This number should be zero.

2 bytes representing bitwise protocol controls. See Table 1.

End of header

1 byte representing the offset at which the data block starts. If zero, the next byte is to be the data block starting
point.

1 byte This is the first byte in the data block, and its the command byte. Valid command bytes were listed in the
previous section.

------- Any number of data bytes. Valid data bytes were listed in the previous section.

1 byte representing a checksum value of the port number byte through the last data byte inclusive.

Protocol control bits - MSB [Refer to Table 1.]


Protocol control bits - LSB [Refer to Table 1.]
Table 1
Bit Bit Name Comment
0 AckReq When set, indicates that an acknowledgement should be sent upon receipt of
this message
1 Ack This bit indicates that the packet is an acknowledgement to a packet
2 Solicited This bit indicates that this packet is a response. When cleared, it indicates
that the sender initiated this exchange.
3 Duplicate This bit indicates that this packet is a duplicate
4 Immediate This packet should be processed immediately
5 NetErr When set, indicates that certain network/protocol error has occurred.
6-15 Undefined

MN29 12
Rev 0

You might also like