Class Modbus_Module
Version 1.0
Modified 08-FEB-2008 11:05:36.53
 Module object for Modbus TCP I/O.
 Defines the type of Modbus action that is to be performed and at which address on the slave.
 The action is defined by a function code which means either reading or writing data to
 the Modbus slave.

 The supported function codes are:

ReadCoils (FC 1)
 This function code is used to read from 1 to 2000 contiguous status of coils in a remote device.
 Typically the input data area is defined by a number of ChanDi's which represent
 the number of coils you want to read. The represenation on the ChanDi should be set to Bit8.

ReadDiscreteInputs (FC 2)
 This function code is used to read from 1 to 2000 contiguous status of discrete inputs
 in a remote device. Typically the input data area is defined by a number of ChanDi's
 which represent the number of coils you want to read.
 The represenation on the ChanDi should be set to Bit8.

ReadHoldingRegisters (FC 3)
 This function code is used to read the contents of a contiguous block of holding registers
 in a remote device.
 Typically the input data area is defined by a number of ChanIi's which represent
 the number of registers you want to read. The represenation on the ChanIi should
 be set to UInt16 or Int16. ChanAi and ChanDi is also applicable. In case of ChanDi the
 representation should be set to Bit16.

ReadInputRegisters (FC 4)
 This function code is used to read from 1 to 125 contiguous input registers
 in a remote device.
 Typically the input data area is defined by a number of ChanIi's which represent
 the number of registers you want to read. The represenation on the ChanIi should
 be set to UInt16 or Int16. ChanAi and ChanDi is also applicable. In case of ChanDi the
 representation should be set to Bit16.

WriteSingleCoil (FC 5)
 This function code is used to write to one single coil.
 Typically the output data area is defined by one ChanDo's which represent
 the state of the coil to write to.

WriteMultipleCoils (FC 15)
 This function code is used to force each coil in a sequence of coils to either ON or OFF
 in a remote Device.
 Typically the output data area is defined by a number of ChanDo's which represent
 the number of coils you want to write. The represenation on the ChanDo should
 be set to Bit8.

WriteMultipleRegisters (FC 16)
 This function code is used to write a block of contiguous registers (1 to 123 registers)
 in a remote device.
 Typically the output data area is defined by a number of ChanIo's which represent
 the number of registers you want to write. The represenation on the ChanIo should
 be set to UInt16 or Int16. ChanAo and ChanDo is also applicable. In case of ChanDo the
 representation should be set to Bit16.

See also



RtBody attributes pwr_sClass_Modbus_Module
String80 Description   Description of module
Modbus_FCEnum FunctionCode   Modbus function code.
UInt16 Address   Address of data area on Modbus slave.
UInt16 UnitId   Unit id.
ModbusModule_StatusEnum Status   Module status.
YesNoEnum Continuous   Continuous operation of the module.
Boolean SendOp   Request to execute action defined by FunctionCode-attribute once.
UInt32 ScanInterval   Specifies, in relation to the scantime of the thread, how
often the module is handled. If ScanInterval i 1, the module
is handled every scan. If ScanInterval is for example 10, it
is handled every 10'th scan, i.e. the scantime for the module
will be ScanInterval times the scantime of the thread.
IoProcessMask Process   Process that handles the card. Plc(1), rt_io_comm(2) or application process(4).
Objid ThreadObject   Plc thread that handles the module.


Template Object
Continuous 1
ScanInterval 1
Process 1


Attributes detail


Description Attribute
Klass Attribute
Typ String80
Flags
Kropp RtBody
Description of module

FunctionCode Attribute
Klass Attribute
Typ Modbus_FCEnum
Flags
Kropp RtBody
The function code defines the action that is to be perfomed with the Modbus slave.
The module is handled with the scantime of the thread.
The supported function codes are:

(FC 1) ReadCoils
(FC 2) ReadDiscreteInputs
(FC 3) ReadHoldingRegisters
(FC 4) ReadInputRegisters
(FC 5) WriteSingleCoil
(FC 15) WriteMultipleCoils
(FC 16) WriteMultipleRegisters

Address Attribute
Klass Attribute
Typ UInt16
Flags
Kropp RtBody
Address of data area on Modbus slave.

UnitId Attribute
Klass Attribute
Typ UInt16
Flags
Kropp RtBody
Identification of the modbus unit to communicate with. It is typically only used
if communicating with a tpc gateway that is connected to a Modbus serial line with
possibly several units. Usually this has no meaning and should be set to zero (0).

Status Attribute
Klass Attribute
Typ ModbusModule_StatusEnum
Flags State|Noedit
Kropp RtBody
Module status.

Continuous Attribute
Klass Attribute
Typ YesNoEnum
Flags
Kropp RtBody
If set to Yes the module is scanned cylically for each scan (read or write operation).
If set to false the action defined by the FunctionCode-attribute will only be executed
when the SendOp-attribute is set.

SendOp Attribute
Klass Attribute
Typ Boolean
Flags
Kropp RtBody
This attribute is only valid if Contious-attribute is set to 'No'.

ScanInterval Attribute
Klass Attribute
Typ UInt32
Flags
Kropp RtBody
Specifies, in relation to the scantime of the thread, how
often the module is handled. If ScanInterval i 1, the module
is handled every scan. If ScanInterval is for example 10, it
is handled every 10'th scan, i.e. the scantime for the module
will be ScanInterval times the scantime of the thread.

Process Attribute
Klass Attribute
Typ IoProcessMask
Flags
Kropp RtBody
Process that handles the card.

1: The card is read by the plc process, and is handled by a specific
   thread in the plc, which is specified in the ThreadObject attribute.
2: The card is read by the rt_io_comm process.
4: The card is handled by an application program.

ThreadObject Attribute
Klass Attribute
Typ Objid
Flags
Kropp RtBody
The PlcThread object of the plc thread that handles the module.
The module is handled with the scantime of the thread.