dev =
modbus ('tcpip', deviceaddress)
¶dev =
modbus ('tcpip', deviceaddress, remoteport)
¶dev =
modbus ('tcpip', deviceaddress, name, value)
¶dev =
modbus ('serialrtu', serialport)
¶dev =
modbus ('serialrtu', serialport, name, value)
¶Open modbus interface using a specified transport of ’tcpip’ or ’serialrtu’.
deviceaddress - the device ip address of type String.
remoteport - the device remote port number. If not specified, a default of 502 will be used.
name, value - Optional name value pairs for setting properties of the object.
serialport - the name of the serial port to connect to. It must be specified when transport is ’serialrtu’.
timeout value used for waiting for data
number of retries after a timeout
Additional data to attach to the object
Baudrate for the serial port
number of databits for serial port
Parity for serial port (’odd’, ’even’ or ’none’)
number of stopbits for serial port
The modbus() shall return instance of octave_modbus class as the result modbus.
The modbus object has the following public properties:
name assigned to the modbus object
instrument type ’modbus’ (readonly)
Remote port number or serial port name (readonly)
Device address if transport was ’tcpip’ (readonly)
status of the object ’open’ or ’closed’ (readonly)
timeout value used for waiting for data
number of retries after a timeout
Additional data to attach to the object
Package: instrument-control