Omron TJ2-MC64 - PROGRAMMING Programming Manual page 225

Hide thumbs Also See for TJ2-MC64 - PROGRAMMING:
Table of Contents

Advertisement

Communication protocols
4.3.3
ModbusRTU
The ModbusRTU protocol provides single point to point communication
between the TJ2-MC64 and a ModbusRTU master. Implementation of
the protocol is provided on serial port 1 for RS232 and port 2 for RS485.
Baud rate and slave address can be set in the BASIC program during serial
port initialisation.
The Modbus protocol is initialised by setting the mode parameter of the
SETCOM instruction to 4. The ADDRESS parameter must also be set
before the Modbus protocol is activated.
Example
ADDRESS=1
SETCOM(9600,8,1,2,1,4) 'Port 1 as MODBUS port at 9600 baud
ADDRESS=1
SETCOM(19200,8,1,2,2,4) 'set up the RS485 port at 19200 baud
The protocol can be de-selected by setting the option to 0 in the SETCOM
command.
SETCOM(19200,8,1,2,2,0) 'set the RS485 port to normal mode.
Functions
The following Modbus functions are supported:
/i
Code
Function name
1
Read Coil Status
2
Read Input Status
3
Read Holding Registers
5
Force Single Coil
6
Set Single Holding Register
16
Set Multiple Holding Registers
PROGRAMMING MANUAL
Action
Read I/O
Read I/O
Read VR variables or TABLE memory in both
integer or IEEE floating point format
Write I/O
Write to a VR variable or a TABLE location in
both integer or IEEE floating point format
Write to multiple VR variables or TABLE loca-
tions in both integer or IEEE floating point for-
mat
Code
Function name
23
Read & Write Multiple Holding
Registers
Action
in both integer or IEEE floating point format
219

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tj1-prtTj1-drtTj1-cortTj1-mlGrt1-ml2Tj1-fl02

Table of Contents