<< modbus_connect modbus modbus_free >>

modbus >> modbus > modbus_flush

modbus_flush

flush non-transmitted data

Calling Sequence

status = modbus_flush(mbc)
[status, ierr] = modbus_flush(mbc)

Arguments

mbc

The modbus connection created with modbus_new_tcp or modbus_new_rtu

status

0 (or the number of flushed bytes) if flush was successful and -1 otherwise.

ierr

Erreur number.

Description

Discard data received but not read

When called with one output argument, a Scilab error will occur when the flushing 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_connect(mbc);
modbus_flush(mbc);
modbus_close(mbc);
modbus_free(mbc);

See Also


Report an issue
<< modbus_connect modbus modbus_free >>