.. _object_ModbusClient: :index:`ModbusClient` --------------------- Description *********** The ModbusClient object is the base class for all Modbus clients (masters) and manages a number of Modbus slaves to communicate with. :**› Inherits**: :ref:`ModbusDevice ` :**› Inherited by**: :ref:`ModbusRtuMaster `, :ref:`ModbusTcpClient ` Overview ******** Properties ++++++++++ .. hlist:: :columns: 2 * :ref:`numberOfRetries ` * :ref:`slaves ` * :ref:`timeout ` * :ref:`ModbusDevice.activityLed ` * :ref:`ModbusDevice.autoConnect ` * :ref:`ModbusDevice.error ` * :ref:`ModbusDevice.errorString ` * :ref:`ModbusDevice.state ` * :ref:`Object.objectId ` * :ref:`Object.parent ` Methods +++++++ .. hlist:: :columns: 1 * :ref:`pollSlaves() ` * :ref:`ModbusDevice.connectDevice() ` * :ref:`ModbusDevice.disconnectDevice() ` * :ref:`Object.deserializeProperties() ` * :ref:`Object.fromJson() ` * :ref:`Object.serializeProperties() ` * :ref:`Object.toJson() ` Signals +++++++ .. hlist:: :columns: 1 * :ref:`slavesDataChanged() ` * :ref:`ModbusDevice.connected() ` * :ref:`ModbusDevice.disconnected() ` * :ref:`ModbusDevice.errorOccurred() ` * :ref:`Object.completed() ` Enumerations ++++++++++++ .. hlist:: :columns: 1 * :ref:`ModbusDevice.BusInterface ` * :ref:`ModbusDevice.Error ` * :ref:`ModbusDevice.State ` Properties ********** .. _property_ModbusClient_numberOfRetries: .. _signal_ModbusClient_numberOfRetriesChanged: .. index:: single: numberOfRetries numberOfRetries +++++++++++++++ This property holds the number of retries a client will perform before a request fails. :**› Type**: SignedInteger :**› Default**: ``3`` :**› Signal**: numberOfRetriesChanged() :**› Attributes**: Writable .. _property_ModbusClient_slaves: .. _signal_ModbusClient_slavesChanged: .. index:: single: slaves slaves ++++++ This property holds a list of all slaves. :**› Type**: :ref:`List `\<:ref:`ModbusSlave `> :**› Signal**: slavesChanged() :**› Attributes**: Readonly .. _property_ModbusClient_timeout: .. _signal_ModbusClient_timeoutChanged: .. index:: single: timeout timeout +++++++ This property holds the timeout value used by this client :**› Type**: SignedInteger :**› Default**: ``1000`` :**› Signal**: timeoutChanged() :**› Attributes**: Writable Methods ******* .. _method_ModbusClient_pollSlaves: .. index:: single: pollSlaves pollSlaves() ++++++++++++ This method polls the :ref:`slaves ` property. It is called automatically when using a :ref:`Polling ` property modifier on this property and usually does not have to be called manually. Signals ******* .. _signal_ModbusClient_slavesDataChanged: .. index:: single: slavesDataChanged slavesDataChanged(SignedInteger index) ++++++++++++++++++++++++++++++++++++++ This signal is emitted whenever the :ref:`List.dataChanged() ` signal is emitted, i.e. the item at ``index`` in the :ref:`slaves ` list itself emitted the dataChanged() signal.