beautypg.com

ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 226

background image

4. int retVal = writeMultipleCoils(int startReference, int ::iStaticArray , int num)

MODBUS function code 15. Writes binary values into a
sequence of discrete outputs (coils, 0:00000 table). Up to 800
coils.

Parameters:

startAddress – start coils address (range: 1 - 65536)

iStaticArray – static integer array which contains the data to be sent

num - number of coils to be written (range: 1-800)

Returns: 0 on success or error code.

Example:

masterObj.writeMultipleCoils(20, ::iStaticArray, 120)

5. readDiscreteInput (int inputAddress)

MODBUS function code 02. Reads the content of a single discrete input
(input status, 1:00000 table).

Parameters:

inputAddress – input address (range: 1 - 65536)

Returns:

Example:

if(masterObj.readDiscreteInput(i))

TRACE(“Input discrete % - YES”, i)

end if

Function using

For command interpreter only

6. int retVal = readDiscreteInputs(int startAddress, int ::iStaticArray ,

int num)

MODBUS function code 02. Reads the content of the discrete inputs (input
status, 1:00000 table). Up to 2000 coils.

Parameters:

startAddress – start inputs address (range: 1 - 65536)

iStaticArray – static integer array which will contain the data read

num - number of contiguous inputs to be read (range: 1-2000)

Maestro

Software Manual

Ethernet/IP Communication

MAN-MASSW (Ver. Q)

12-6