Omron PLC and temperature meter 485 serial communication realization

Omron PLC and other instruments or communications equipment (whether OMRON instruments or third-party instrumentation), with the use of serial communication protocol macro module or template, for the corresponding procedures according to the instrument or device communication protocol, establish the appropriate communication channel, it the instrument can read and write.

    I worked with third-party customers for over-temperature instrumentation PLC communication, now present to you, please correct me.

    The use of PLC OMRON C200HE-CPU42, with communication module C200HW-COM06, using its A port (RS485) and thermometer TTM-120 communication.1, the use of temperature instruments “god king” TTM-120 communication protocol:EIA standard: RS485Communication: Station 1 to 31Transmission: halfCommunication code: ASCll 7 bits (BCC except) 8 (MSD bit = 0)Interface: 2-wireCommunication speed: 
1200,2400,4800,9600Communication distance: 500MmaxCharacter: Start bit: 1Stop bits: 1/2 bitData: 7/8 bitParity: None / Odd / EvenBCC check: pre / non-selectionAddress: 1 to 99Communication format:Read data: STX (02H start code) Address + (2) + R + identification code (3) + ETX (03H end code)Instrumentation Returns: STX (02H start code) Address + (2) + ACK (06H Response) code + (3) + data (5) + ETX (03H end code)Write Data: STX (02H start code) Address + (2) + W + code (3) + data (5) + ETX (03H end code)Instrumentation Returns: STX (02H start code) Address + (2) + ACK (06H Response) + ETX (03H end code)Error message Response: STX (02H start code) Address + (2) + NAK (15H error response) + Malformed (1) + ETX (03H end code)2, with the protocol macro software CX-PROTOCOL for protocol macroAvailable with CX-PROTOCOL existing systems to the new standard protocol COPY program, to be modified, of course, also be restated.Select the PLC model used in DEVICES new program,A communication port for the parameter setting mode: PROTOCOL MACRO; and set the baud rate and other parameters to the instrument communication formats.Protocol macro program includes several elements: The main is to send information list; receiving information list; the two tables is the basic protocol macro program. There is also a specific acceptance form and send the form, read and write in the form of other functions, read and write in the form of other functions of the instrument.I made four kinds of Meter agreement each format, the preparation of macro programs, as follows:Send message list: 
① Write Data: SD (01) _1<span title=":STX “>: STX<span title=":ETX “>: ETXData type: Variable Format ($ (R (2), 5))Address Format: ASCll variable format ($ (R (1), 2)“W”: write requestIdentifier (instrument function parameters: Write set value) “space SV”<span title="数据格式:++"W"+" SV"+($(R(2),5))+ “>Data format: + + “W” + “SV” + ($ (R (2), 5)) + ② read request: SD (02) _1Address Format: ASCll variable format ($ (R (1), 2)“R”: a read requestIdentifier (instrument function parameters: read in process values) “PV1”<span title="数据格式:++"R"+"PV1"+ “>Data format: + + “R” + “PV1” + Accept the list: 

① accepts the response: RV (01) _1“ACK”: Response to accept<span title="数据格式:++"ACK"+ “>Data format: + + “ACK” +

<span title="数据格式:++"ACK"+ “> ② accept data: RV (02) _1Data type: Variable Format (& (W (1), *)) stored in the PLC designated to receive data<span title="数据格式:+(&(W(1),*))+ “>Data format: + (& (W (1), *)) + Write command:No: 050Command: sending & receivingSend command: SD (01) _1Receive commands: RV (01) _1Reads the command:No: 051Command: sending & receivingSend command: SD (02) _1Receive commands: RV (02) _1Preparation set, stored to the PLC.3, with the CX-PROGRAMMER for Communication ProgramsProgram in agreement with the macro PMCR complete communication instrument:Three operands: a: Control word: port + protocol macro sequence numberII: the first site to send data 2/3 words, the first word is the instruction words; the next word address for the instrument;For more than a word write command to the set valueThree: the first site to receive data representing four words, the first word is the command word; the word is under five received data.For a write command the operand is a dummy word has no real meaningRead command: PMCR # 1051 = 1 serial port number 051 (read)DM0000 DM0000 = # 0002 DM0001 = # 0001DM0030 DM0030 = # 0004 DM0031 ~ DM0033 = dataWrite instructions: PMCR # 1050 = 1 serial port number 050 (written)DM0020 DM0020 = # 0003 DM0021 = # 0001 DM0022 = settingsDM0040 (dummy)Protocol Macro Execution Flag: a port (A): α machine is IR289.08 CQM1H to IR207.08Port two (B): α machine is IR289.12 CQM1H to IR207.12When this variable = 0, before implementation PMCR commandEach port can only perform a sequence of communication, different time periods can generate pulses PMCR instruction execution.4, for a number of instruments, each table set different station number, you can make it by the program are read and write operations, the instrument can respond to only address match.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.