<< modbus_setTimeout modbus modbus_writeBit >>

modbus >> modbus > modbus_tcpListen

modbus_tcpListen

create and listen a TCP Modbus socket.

Calling Sequence

status = modbus_tcpListen(mbc, nbConnection)
[status, ierr] = modbus_tcpListen(mbc, nbConnection)

Arguments

mbc

The Modbus connection created with modbus_newTcp or modbus_newRtu.

nbConnection

The number of connection to listen to.

status

0 if connection was successful and -1 otherwise.

ierr

Erreur number.

Description

Create a socket and listen for nbConnection incoming connections.

When called with one output argument, a Scilab error will occur when the operation fails. When called with two output arguments, no Scilab error will occur but ierr will contain the internal modbus error number.

Examples

mbc = modbus_newTcp("127.0.0.1", 502)
modbus_tcpListen(mbc, 1)
modbus_close(mbc)
modbus_free(mbc)

Report an issue
<< modbus_setTimeout modbus modbus_writeBit >>