4 slave (server) functionality implementation – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 230

Advertising
background image

Maestro

Software Manual

Ethernet/IP Communication

MAN-MASSW (Ver. Q)

12-10

8. int retVal = readInputRegisters(int startAddress, ,::iStaticArray,

int num)

MODBUS function code 04. Read the contents of the input registers (3:00000
table). Up to 125 registers.

Parameters:

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

iStaticArray – static integer array which will contain the data read

num - number of registers to be read (range: 1-125)

Returns: 0 on success or error code.

Example:

masterObj.readInputRegisters(1::iStaticArray,10)

12.4 Slave (Server) functionality implementation

The MODBUS Slave implements the Server Engines for each MODBUS slave protocol
flavor. The MODBUS Slave can have one of following types (Figure 12-3):

Figure 12-3: MODBUS Slave types

TCP communication

Parameters:

o

MODBUS address (view paragraph 1.1)

o

Port (view paragraph 1.1, 502 – default port value)

RTU over Serial communication

Parameters:

o

MODBUS address (view paragraph 1.1)

o

Serial port
Serial port identifier (default port value "COM1", for information only)

o

Baud rate
Port baud rate in bps (typically 38400)

o

Data bits
Port data bits (for RTU Must be SER_DATABITS_8)

o

Stop bits
Port stop bits

o

Parity
Port parity: no parity, odd parity or even parity

Advertising