2 modbus master object bit access functions – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 224

Advertising
background image

12.3.1 MODBUS Master Object Communication Control

Functions

NOTE:

Here the iStaticArray – int static array is defined by the user

To use Static Array as a function parameter, a ‘::’ symbol must be used before the

Static Array name.

1- int retVal = openProtocol()

Connects to a MODBUS slave (server)

Returns: 0 on success or error code.

Example:

masterObj.openProtocol()

2- int retVal = closeProtocol()

Closes a connection to a slave (server)and releases any system resources
associated with the connection.

Returns: 0 on success or error code.

Example:

masterObj.closeProtocol()

3- int retVal = isOpen()

Returns whether currently connected or not (1 if open)

Example:

if( !masterObj.isOpen() )

masterObj.openProtocol()

end if

12.3.2 MODBUS Master Object Bit Access Functions

For Modicon Register Table 0:00000 (Coils) and Table 1:0000 (Inputs).

1. readCoil(int coilAddress)

MODBUS function code 01.
Reads the status of a single discrete output (coils, 0:00000 table) in a remote
device (server).

Maestro

Software Manual

Ethernet/IP Communication

MAN-MASSW (Ver. Q)

12-4

Advertising