Modbus Class Summary

The Modbus Class in GPL supports master access to MODBUS/TCP slave devices connected to the local Ethernet network.  MODBUS/TCP is an "open" de facto standard protocol that is widely used in the industrial manufacturing environment to communicate between intelligent devices.  It has been implemented by hundreds of vendors on thousands of different products to communicate digital and analog I/O and register data between devices.

Table 19-66 briefly summarizes the properties and methods for this Class, which are described in greater detail in the following sections.

Table 19-66: Modbus Class Summary

Modbus Class Member Type Description

New Modbus

Constructor Method

Creates an object for a MODBUS connection and specifies the IP address.

modbus_obj.Close

Method

Closes any connections associated with this object.

modbus_obj.ReadCoils

Method

Reads one or more outputs.

modbus_obj.ReadDeviceId

Method

Reads the device ID strings.

modbus_obj.ReadDiscreteInputs

Method

Reads one or more inputs.

modbus_obj.ReadHoldingRegisters

Method

Reads one or more holding registers.

modbus_obj.ReadInputRegisters

Method

Reads one or more input registers.

modbus_obj.Timeout

Get/Set Property

Gets or sets the timeout, in milliseconds, that this connection will wait for a reply before throwing an exception.

modbus_obj.WriteMultipleCoils

Method

Writes multiple outputs.

modbus_obj.WriteMultipleRegisters

Method

Writes multiple holding registers.

modbus_obj.WriteSingleCoil

Method

Writes a single output.

modbus_obj.WriteSingleRegister

Method

Writes a single holding register.