Mon Dec 15 06:18:56 1986 Honeywell PCSI Interface Description Page 1 RTIME Interface for Honeywell PCSI SUMMARY: Two issues need to be addressed: 1) serial protocol to the PCSI, and 2) converting Honeywell's raw binary data to engineering units. The serial protocol is rather straight forward ASCII hex format. The only probable problem is in the Longitudinal Redundancy Check (LRC). There is a sample in the book that does not match the verbiage. In the worst case, this can be resolved on site. A test program needs to be written to confirm the connection to the Honeywell system and the LRC problem (if any) can be resolved with it. The issue of converting raw binary data to engineering units is more complex. There are three choices: 1) automatic conversion from RTIME with no formulas from PICON, 2) use only formulas supplied by PICON only, and 3) allow a combination of options one and two. The automatic conversion involves reading some additional data fields from the Honeywell system on the first reading of a sensor. The advantages of using the automatic mode is that the sensor specific "tuneable" parameters (such as, the offset for a particular thermocouple) need not be changed in PICON when sensor maintenance is done. The disadvantage is, of course, the additional work required in RTIME. The coding time would be about five days and debug would be increased by about two days. Because of the added power to the interface and the fact that this interface will be used by multiple customers, I recommend that we do option three (both automatic and manual). SERIAL PROTOCOL: The PCSI is a "one sensor reading at a time" device. To be able to increase thruput, we need to be able to accommodate two PCSI connections on one system as a customer setable option (i.e. the customer need only run "param" to add the additional channel. My choice is to add a delimiter to the device specifier and be able to specify a second device. This would interpreted in the connection section of the driver interface and open two channels plus setting the flags needed to run both channels. Mon Dec 15 06:18:56 1986 Honeywell PCSI Interface Description Page 2 SERIAL PROTOCOL FORMAT The protocols that RTIME needs to know are: READ REQUEST : 04 AAAA XX [CR] RESPONSE : 04 DDDD XX [CR] ERROR : 84 SSSS XX [CR] WRITE REQUEST : 06 AAAADDDD XX [CR] RESPONSE : 06 (none) XX [CR] ERROR : 86 SSSS XX [CR] INITIALIZE (used for error recovery) REQUEST : 66 (none) 9A [CR] RESPONSE : 66 (none) 9A [CR] ABORT/RESTART REQUEST : 70 (none) 90 [CR] RESPONSE (none) SWAP HIGHWAY REQUEST (used for highway noise) REQUEST : 67 (none) 99 [CR] ERROR : E7 SSSS XX [CR] | | | | |_ Frame Terminator | | | |_____ LRC | | |______________ Address/Data | |___________________ Function Code |______________________ Start of Frame Notes: 1) Spaces shown in frame are for readability only. 2) All characters are ASCII hex. 3) AAAA = binary highway address converted to ASCII hex. 4) DDDD = binary data converted to ASCII hex. 5) SSSS = binary status information converted to ASCII hex. 6) [CR] is a single carriage return character. Additional commands for test are: TEST RESPONSE REQUEST : 08 MMMMMMMM XX [CR] RESPONSE : 08 MMMMMMMM XX [CR] ERROR : 87 (none) 79 [CR] PCSI STATUS CHECK REQUEST : 65 (none) 9B [CR] RESPONSE : 65 SSSS XX [CR] TEST 2 WRITE REQUEST : 68 RRRRDDDD XX [CR] RESPONSE : 68 (none) 98 [CR] TEST 3 READ REQUEST : 69 RRRR XX [CR] RESPONSE : 69 DDDD XX [CR] READ FIRMWARE (Reads PCSI Firmware ID, Type, and Revision) REQUEST : 6A (none) XX [CR] RESPONSE : 6A FFFF XX [CR] Notes: 1) MMMMMMMM = 8 character hex string. 2) RRRR = register number of register in PCSI. where: 0001 is highway address register. 0002 is highway data register. 3) FFFF = hex PCSI firmware ID. Mon Dec 15 06:18:56 1986 Honeywell PCSI Interface Description Page 3 SERIAL PROTOCOL LONGITUDINAL REDUNDANCY CHECK The LRC description is : " The error check is produced by converting the hex wrap-around carry, and two's complementing the result. The colon and the [CR] are ignored in the calculation." EXAMPLE: String to send - :08AAAA5555??[CR] ASCII BINARY 1) 08 00001000 2) AA 10101010 2) AA 10101010 4) 55 01010101 5) 55 01010101 BINARY SUM 00000110 TWO'S COMPLEMENT 11111010 Send - :08AAAA5555FA[CR] The problem is the words "wrap-around carry". The example is based on ignore carry. So?? Mon Dec 15 06:18:56 1986 Honeywell PCSI Interface Description Page 4 SERIAL PROTOCOL DATA HIGHWAY ADDRESS SCHEME The data highway address scheme: The data highway address is based on 16 bits. M L S S B B 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 ---------------------- -------------- ---------- --------- | RECEIVER | SLOT/LOOP | SUB | FUNCTION | --------------------------------------------------------------- RECEIVER = Hiway Data Address (Box number) SLOT/LOOP = Each box contains from 1 to 16 sensor control loops numbered 0 to 15. From a unix point of view these can be considered structures. SUB = FUNCTION = In most cases, SUB and FUNCTION are combined too address one of the up to 64 elements of the SLOT/LOOP. Honeywell refers to what I call elements as "Data Base Slot Locations". Since SLOT has another meaning and the full title is to long, I will refer to "Data Base Slot Locations" as elements. The common number base used in Honeywell is octal. Thus, RECEIVER 10. SLOT 7. ELEMENT 2. would be described as 120702 in the system. Since the PCSI expects ASCII hex that octal address would be converted to A1C2 ASCII hex. The routing code from PICON will be octal. Mon Dec 15 06:18:56 1986 Honeywell PCSI Interface Description Page 5 CONVERTING RAW BINARY TO ENGINEERING UNITS CONVERTING RAW BINARY TO ENGINEERING UNITS: OVERVIEW: There are three general cases to be considered: 1) automatic conversion from general devices like a basic controller and analog units. 2) automatic conversion for extended controllers. 3) non automatic conversion. The automatic conversion would apply only to the variables process value (x input), output, set point (y input), high limit, and low limit. All other values would be non-automatic. The problem is that there are two data structure formats in the system. One structure is for the older devices like the basic controller and the other structure is for new devices like the extended controller. To specify which one of the three types of conversion are to be used the knowledge engineer will have to append a flag (control byte) to the route name. This flag will allow automatic conversion for an estimated 90% of the values used plus the flexibility to get to all the values in the Honeywell data base. The format of the route would be: RRSSx where: RR = ASCII octal 2 digit number of the receiver. SS = ASCII octal 2 digit slot/loop number. x = ASCII letter B for a basic controller format. or x = ASCII letter E for a extended controller format. or x = ASCII octal 2 digit number for the sub-function. In the case where the x position was B or E, automatic conversion would be done. Engineering units would be returned for all but the output variable and it would be returned in percent. In the case where x was a two digit octal, the raw binary number would be returned. If the formula field is added to the sensor frame RTIME would pre-process the raw binary by the supplied formula. Mon Dec 15 06:18:56 1986 Honeywell PCSI Interface Description Page 6 RAW BINARY FORMATS RAW BINARY FORMATS: The following is an excerpt from the Honeywell manual. The raw binary is stored in two's complement in one of three formats: B0, B12, and B12E. The bits to the left of the radix point represent whole numbers. Each binary format has the general format: BnE where: B = binary value n = the number of bits to the left of the radix point E = excess 247 (decimal) when specified. Example of B12 format: M L S S B B 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | | ||_ Radix point | |________________________________|__ Total 12 bits |______________________________________ Sign, 1 = negative A B0 format indicates a fractional value since there are no bits to the left of the radix. In excess format (i.e., E suffix) 247 (decimal) is the amount that the decimal value goes below zero, or above 100 percent. This relates to the analog signal current range of 4mA to 20mA, where 4mA represents 0% and is equated to 247 (decimal). Moreover, 20mA represents 100% and equated to 3847 (decimal). By using excess 247 (decimal) arithmetic, the displayable range is -6.86% to 106.9%. In using excess 247 arithmetic, a percent (decimal) value can be changed to octal by multiplying the percent by 36, adding 247, and converting the decimal sum to an octal number. Note by CGK: Sensor inputs and many other variables are stored in percent of range using the B12E format. Most conversions to engineering units, first convert to percent then apply one of fourteen (14) formulas with two "magic" numbers to "fine tune" the results. Mon Dec 15 06:18:56 1986 Honeywell PCSI Interface Description Page 7 SLOT/LOOP FORMATS BASIC CONTROLLER SLOT/LOOP FORMATS: BASIC CONTROLLER SLOT- SLOT DESCRIPTION FORMAT 00 Configuration word A Binary 01# Configuration word B Binary 02* Process Variable B12E 03 Remote Variable B12E 04!* Local Set Point B12E 05* X Input (Treat as Process Variable) B12E 06* Y Input (Treat as Set Point If Reading) B12E 07 Computer Set Point (CSP) B12E 10 Computer DDC Output (CO) B12E 11 Ratio Coefficient (R) B4 12 Bias Coefficient (B) B12 13# Eng. Units Conversion Bias (B) B12 14# Eng. Units Conversion Slope (M) B0 15 Gain Constant (K) or Y Multiplier (Ka) B7 or B4 16 Integral(K1), Lag(Klg), or X Multi.(K1) B0,B0,or B4 17 Derivative (Kd), Lead(Kld), or Bias(k2) B0,B15, or B12 20 Digital Filter Time Constant (Kf) B0 21 Error (Deviation X-Y)(E) B12 22 Slot Status Binary 25* Valve Output After Limits (Output) B12E 26 High Integral Limit or Override Low Bias B12E 27* Low Alarm Limit (PV = B12E deviation = B12) B12E or B12 30* High Alarm Limit (PV = B12E dev. = B12) B12E or B12 31 Low Output Limit B12E 32 High Output Limit B12E 33 Low Integral Limit or Override High Bias B12E 35 Mode of Operation Binary 36 Alarm Word Binary 37 Output in Hold Station(rounded to 10 bits) B12E 50 RV Configuration Word B Binary 51 RV Target Value B12E 52 RV Eng. Units Conversion Bias (RV-B) B12 53 RV Eng. Units Conversion Slope (RV-M) B0 SLOT Codes: # = Read for automatic conversion to engineering units. ! = Write location on set. * = Automatic engineering unit conversion slots. Configuration Word B: MSB LSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | | | |_Alarm Type: 0 Devation, 1 PV | | |____Temp type: 0 Fahrenheit, 1 Celsius | | (ignored if Linear or Sq. Rt. type) |_____|_______Engineering Unit Conversion Type 0 Linear 1 Thermocouple type J 2 Thermocouple type K 3 Thermocouple type T Mon Dec 15 06:18:56 1986 Honeywell PCSI Interface Description Page 8 SLOT/LOOP FORMATS BASIC CONTROLLER 4 Thermocouple type S 5 Square Root 6 Platinum RTD 7 RH Radiamatic Mon Dec 15 06:18:56 1986 Honeywell PCSI Interface Description Page 9 PRIMARY EXTENDED CONTROLLER DIFFERENCES PRIMARY EXTENDED CONTROLLER DIFFERENCES: SLOT DESCRIPTION FORMAT 00 MODERQUST BINARY 01 Constants NOT Configuration Word B N/A 03 not available 13 RANGE-X-0% (assume Eng. Units Bias) B12 14 RANGE-X-100% (assume Eng. Units Slope) B0 63 Configuration Word A Binary 64 Configeration Word B Binary 65 Configeration Word C Binary 66 Configeration Word D Binary 67 Configeration Word E Binary 70 Configeration Word F Binary 71 Configeration Word G Binary 72 Configeration Word H Binary Configuration Word C: MSB LSB 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | | |__|_ Temperature |________|_______ Formulas Temperature Table: (ignore on linear and sq.rt formulas) 00 degres F 01 degres C 10 degres R 11 degres K Formula Table: 0000 Linear 0001 Thermocouple type J 0010 Thermocouple type K 0011 Thermocouple type T 0100 Thermocouple type S 0101 Square Root 0110 Thermocouple type PRB (Burns) 0111 Thermocouple type RAD 1000 Thermocouple type B 1001 Thermocouple type E 1010 Thermocouple type R 1011 Thermocouple type R' (JIS) 1100 Thermocouple type PRB (DIN) 1101 Thermocouple type PRB (JIS) 1110 Linear 1111 Linear