Returns the value associated with the given connection parameter. QVariant QModbusDevice:: connectionParameter( int parameter) const This function calls open() as part of its implementation. Final connection success confirmation requires the state() changing to QModbusDevice::ConnectedState. Returns true if the connection process was successfully initiated otherwise false. bool QModbusDevice:: connectDevice()Ĭonnects the device to the Modbus network. The implementation must ensure that the instance's state() is set to QModbusDevice::UnconnectedState.
This function is responsible for closing the Modbus connection. QModbusDevice:: ~QModbusDevice()ĭestroys the QModbusDevice instance void QModbusDevice:: close() This signal is emitted every time the state of the device changes. void QModbusDevice:: stateChanged( QModbusDevice::State state) This signal is emitted when an error of the type, error, occurs. void QModbusDevice:: errorOccurred( QModbusDevice::Error error) Member Function Documentation QModbusDevice:: QModbusDevice( QObject * parent = nullptr)Ĭonstructs a Modbus device with the specified parent.