TOHO ELECTRONICS INC.
Thank you very much for purchasing a TRM-006A Series (with communications). Please read this operation manual carefully and use this product correctly. Contents 1. Before using the product...................................................................................................... 4 1.1 On this operation manual 1.2 Conditions for communications 1.3 What can be done with communications 1.4 Positioning communications (priority ranking) 1.5 Setting before communications 2.
6. MODBUS communications control................................................................................... 20 6.1 Communications procedure 6.2 Message types 6.3 Composition of an RTU request message (transmitted from a high-level computer to this product) 6.4 Composition of an RTU response message (transmitted from this product to a high-level computer) 6.5 Description of RTU codes 6.6 Precautions on RTU communications 6.7 Example of CRC-16 calculations 6.
1. Before using the product 1.1 On this operation manual This is an operation manual regarding communications with a TRM-006A Series (hereinafter referred to as "this product"). 1.2 Conditions for communications The communications function of this product is optionally specified. For that reason, you should specify a communications option (RS-485) in purchasing this product. 1.3 What can be done with communications With this product, users can write and read items specified in "9.
2. Settings regarding TOHO communications 2.1 Overview Before communications is performed, initial settings must be made on this product. Enter such settings with the keys on the front panel. To switch to a series of setting screens, take the steps described below. For details, see the operation manual furnished with this product.
2.2 Setting a data length 2.3 Setting a stop bit length 2.4 Setting a parity 2.5 Setting whether to conduct a BCC check While in the "Set a communications parameter" screen on the preceding page, operate the ▲ and ▼ keys to make the settings. The initial value is H H H H. ^ g f o **** F Stop bit 1 I Stop bit 2 c No parity f Odd parity D Even parity N Data length, 7 bits E Data length, 8 bits c BCC check disabled j BCC check enabled 2.
2.8 Setting a response delay Set a time from the time when the high-level computer finished sending a "request message" until the time when it delivers the line and enters an input state. While in the "Set a response delay" on the preceding page, operate the ▲ and ▼ keys to make the settings. The initial value is 0. ^ i r b H Setting range: 0 to 250msec * If the response delay is set to a short setting, the communications may not be conducted normally.
3. TOHO communications control 3.1 Communications procedure This product returns a "response message" in response to a "request message" from a high-level computer. It therefore does not initiate a transmission. Transmitted by a highlevel computer High-level computer Transmitted by this product Request message Transmitted by a highlevel computer Request message Response message This product Transmitted by this product Response delay: 0-250ms Response message 1ms or more See "3.6.
3.3 Composition of a request message (transmitted from a high-level computer to this product) n For codes ① to ⑩, see "3.5 Description of codes." n For specific examples of request messages, see "4.1 Examples of communications to be read" and "4.2 Examples of communications to be written." 3.3.1 Composition of a read request message BCC ETX □ □ □ R □ □ ⑦ BCC data ⑥ End code | ④ Identifier | ③ Contents of the request: read/write ② Address STX ① Start code 3.3.
3.4 Composition of a response message (transmitted from this product to a high-level computer) n For codes ① to ⑩, see "3.5 Description of codes." n For specific examples of request messages, see "4.1 Examples of communications to be read" and "4.2 Examples of communications to be written." 3.4.1 Response message in response to a read request message BCC ETX □ □ □ □ □ □ □ □ ACK □ □ STX ⑦ BCC data ⑥ End code | | ⑤ Numerical data | | | ④ Identifier | ⑧ Acknowledge code ② Address ① Start code 3.4.
3.5 Description of codes n The codes from ① STX, ② address to ⑩ ERR type as indicated below are expressed in ASCII codes. n For the ASCII codes, see "10. Table of ASCII codes." n For conversion to ASCII codes, see "4. Examples of TOHO communications." ① STX This code is needed for the receiver to detect the top of the message. It is affixed to the top of a character string to be sent. ② Address This is the address of the party (this product) with whom a high-level computer communicates.
⑧ ACK It is an acknowledge code. If a message received by this product is error-free, this code will be incorporated in the "response message" from this product and returned. ⑨ NAK It is a negative acknowledge code. If a "request message" received by this product is error-ridden, this code will be incorporated in the "response message" from this product and returned.
3.6 Communications precautions 3.6.1 Communications timing Set a sufficient response delay to make sure that this product is switched over from transmission to reception with regard to a high-level computer in using an RS-485. See the figure in "3.1 Communications procedure" and "2.8 Setting a response delay." 3.6.
3.6.8 Storing data other than a store request message Store all parameters in the EEPROM in either of the two cases described below, even if no store request message is received. 1) If a parameter is changed by key operation 2) If auto-tuning is started and ends normally. 3.6.
4. Examples of TOHO communications 4.1 Examples of communications to be read Example: Request message: This requests this product set at address 27 to read the PV. (High-level computer) In response to that, Response message: This returns PV data (00777).
4.2 Examples of communications to be written Example: Request message: This requests this product set at address 03 to set "the E1F setting to (High-level computer) 011" (write 011). (This sets the function in event 1 to the deviation upper and lower limits + hold.) In response to that, Response message: This returns a notice that the request message has been received. (This product) *Check that it has been written by reading the data separately.
5. Settings regarding MODBUS communications 5.1 Overview Before communications is performed, initial settings must be made on this product. Enter such settings with the keys on the front panel. To switch to a series of setting screens, take the steps described below. For details, see the operation manual furnished with this product.
5.2 Setting a data length 5.3 Setting a stop bit length 5.4 Setting a parity 5.5 Setting a BCC check The BCC check is disabled. Initial value of MODBUS (RTU): E c IInitial value of MODBUS (ASCII): E c I ^ g f o *** F Stop bit 1 I Stop bit 2 c No parity f Odd parity D Even parity N Data length, 7 bits E Data length, 8 bits * The RTU mode settings come only in three types: The ASCII mode settings come only in three types: H H H . H . 5.
5.8 Setting a response delay Set a time from the time when the high-level computer finished sending a "request message" until the time when it delivers the line and enters an input state. While in the "Set a response delay" on the preceding page, operate the ▲ and ▼ keys to make the settings. The initial value is 0. ^ i r b H Setting range: 0 to 250msec * If the response delay is set to a short setting, the communications may not be conducted normally.
6. MODBUS communications control 6.1 Communications procedure This product returns a "response message" in response to a "request message" from a high-level computer. It therefore does not initiate a transmission. Transmitted by a highlevel computer High-level computer Transmitted by this product Request message Transmitted by a highlevel computer Request message Response message This product Transmitted by this product Response delay: 0-250ms Response message 1ms or more, or 3.
6.3 Composition of an RTU request message (transmitted from a high-level computer to this product) n For codes a) through i), see "6.5 Description of RTU codes." 6.3.1 Composition of a read request message a) Slave address 1BH b) Function code 03H c) Register address d) Number of registers e) CRC-16 High level 00H Low level 00H High level 00H Low level 02H High level C6H Low level 31H First register address Fixed at 2 6.3.
6.3.
6.4.3 Response message in the case of an error a) Slave address 1BH b) Function code 83H h) Error code 02H e) CRC-16 High level E1H Low level 36H ← In the case of an error, the function code for the request message + 80H is entered. 6.5 Description of RTU codes n The codes from a) slave address to b) function code to h) error code shown below are expressed in 8-bit binary numbers. a) Slave address This is the address of the party (this product) with which the high-level computer communicates.
g) Data portion This specifies data to be written in the register. The data is fixed at 4 bytes. This product will write data without the decimal point. Example: In the case of numerical data Example Significance of the value Proportional band (P) = 1.0 % 0000000AH PV = 1200.0°C 00002EE0H SV = -10.00°C FFFFFC18H In the case of text data, write the ASCII code "□INP" (□ is a space): 20494E50H.
6.6 Precautions on RTU communications 6.6.1 Communications timing Set a sufficient response delay to make sure that this product is switched over from transmission to reception with regard to a high-level computer in using an RS-485. See the figure in "6.1 Communications procedure" and "5.8 Setting a response delay." 6.6.2 Interval between requests In transmitting a series of "request messages" from a high-level computer, allow for an interval of 1msec or more or 3.
6.6.8 Storing data other than a store request message This product will store all parameters in the EEPROM in either of the two cases described below, even if no store request message is received. 1) If a parameter is changed by key operation 2) If auto-tuning is started and ends normally. 6.6.
6.8 Composition of an ASCII request message (transmitted from a high-level computer to this product) n For the codes a) through g), see "6.10 Description of ASCII codes." 6.8.1 Composition of a read request message a) Start code “:” b) Slave address “1” , “B” c) “0” , “3” Function code d) Register address e) Number of registers f) High level “0” , “0” Low level “0” , “0” High level “0” , “0” Low level “0” , “2” LRC “E” , “0” g) End code CR, LF First register address Fixed at 2 6.8.
6.8.
6.9.2 Response message for a write/store request message a) Start code b) Slave address “0” , “3” c) Function code “1” , “0” d) Register address e) Number of registers “:” High level “0” , “0” Low level “0” , “0” High level “0” , “0” Low level “0” , “2” f) LRC “E” , “B” g) End code CR, LF First register address Fixed at 2 6.9.3 Response message in the case of an error a) Start code 6.
d) Number of registers This specifies the number of registers to be written in. Since this product has a fixed number of registers (which is 2), specify 0002H. e) Register address The locations of the data to be read or that to be written are specified in 2 bytes. For the addresses of the commands, see "9. Table of identifiers (codes)." f) LRC LRC is an error check code for detecting message errors. An LRC is transmitted.
j) Error code If a message from a high-level computer is error-ridden, it will be incorporated in the "response message" from this product and returned. The error number "0" is an instrument error (memory error or A/D conversion error). It will be incorporated in the "response message" regardless of whether there is an error in the "request message." Error number "9" is an AT error. It is therefore incorporated into the "response message" regardless of whether the "request message" is error-ridden.
6.11.4 Errors in address specification This product will not respond to any "request message" that specifies an address other than that specified for itself. If, therefore, the address portion of a "request message" is error-ridden, none of the mobile units will return a "response message." Therefore, the high-level computer transmits the necessary "request message" again if a "request message" is sent to this product but the latter does not return a "response message" at the end of an appropriate period.
Then enter calculable data into the 1rc_arry(), and enter the number of data items into the arry_count. After that, run the following program to cause the calculation results to enter the LRC. For i = 0 To arry_count LRC = (LRC + lrc_arry(i)) And &HFF Next LRC = ((Not LRC) + 1) And &HFF If the error code is calculated as 12H as an example, affix a "1" or "2" at the end of the message.
7. Specifications 7.1 Communications standard category Compliant with EIA standard RS-485 7.2 Communications specifications 7.2.1 Communications system Network: ........................................ Multi-drop system (up to 1 pair, 31 stations) Direction of information: ............... Half duplex Synchronization system: ................ Asynchronous Transmission code: ........................ ASCII, 7 bit code, except for BBC data (highest-level bit = 0 in 8-bit code) 7.2.
8. Connections This product (mobile unit) High-level computer (parent stations) T/R(A) T/R(A) T/R( B) T/R(B) T/R(A) T/R(B) T/R(A) T/R(B) Install an end of line resistor at both of the farthest devices in the parent station and the mobile unit. For a resistance value, use one that matches the characteristic impedance of the cable. Provided that the synthesis is set to at least 75Ω.
9. Table of identifiers (codes) ¢ For the setting range, options, initial values, and similar parameters, see the operation manual for this system. a) Identifier: This code represents an item. Enter this code in the identifier field in the message. The □ in the frame represents an SP (ASCII code: 20H). b) Character: The character to be displayed on the system screen. c) Name: Item name d) R/W: This specifies which is possible: reading, writing, or both.
MODBUS address Identifier Low-level W High-level W Character □DP 30 31 ^ LOC 34 35 SLH 36 SLL Q F Name R/W Description Set a decimal position R/W R/W the decimal position setting No decimal point: 00000 Tenth: 00001 For analog input, following available: Hundredth: 00002 Thousandth: 00003 ^ o Q F Set a key lock R/W R/W the key lock setting 37 ^ o Q F Set a scaling upper limit R/W R/W the PV range upper limit setting 38 39 ^ o Q F Set a scaling lower limit R/W R/W the PV ra
MODBUS address Identifier Low-level W High-level W Character Name R/W Description TRH 164 165 ^ o Q F Set an upper limit for transmission output scaling R/W R/W the upper limit setting for transmission output scaling TRL 166 167 ^ o Q F Set an lower limit for transmission output scaling R/W R/W the lower limit setting for transmission output scaling OM1 170 171 Output status monitor R Read the output monitor ①②③④⑤ ⑤: EV1 (1:ON 0:OFF) ④: EV2 (1:ON 0:OFF) STR 176 177 Store data
10.
TOHO ELECTRONICS INC. Head office: 1-13-21, Tanashioda, Sagamihara Kanagawa 229-1125 Japan.