File Information
Library: IoT/Modbus
Package: Generated
Header: IoT/Modbus/ModbusMasterSkeleton.h
Description
This class defines the interface for Modbus clients.
The interface supports two basic modes of operation:
- Asynchronous requests: One of the sendXXXRequest() methods is used to send a request to the device. The method returns as soon as the request has been queued to be sent over the wire (actual sending is done in a separate thread). The device's response, is reported asynchronously via an appropriate XXXResponseReceived event. Errors encountered during sending are reported via requestFailed. Modbus exception responses are reported via exceptionReceived. A timeout waiting for the response is reported via the timeout event.
- Synchronous requests: After sending the request, the method waits for the response from the device and directly returns it to the caller. In case no response is received within the specified timeout, a Poco::TimeoutException is thrown. If an exception message is received from the device, a ModbusException is thrown. If an incomplete or invalid message is received, a Poco::ProtocolException is thrown.
Note that asynchronous and synchronous (blocking) mode cannot be used simultaneously. Calling one of the asynchronous request methods will enable asynchronous mode. Calling one of the synchronous request methods will disable asynchronous mode. Switching to synchronous mode while a response to an asynchronous request is pending will lead to undefined results, including possible mismatch of requests and responses.
In asynchronous operation, requests are associated with a transaction ID, to tell apart multiple concurrent transactions. Transaction IDs are not guaranteed to be unique for subsequent requests. In fact, for Modbus RTU, which does not allow multiple simultaneous requests, the transaction ID will always be zero.
Inheritance
Direct Base Classes: Poco::RemotingNG::Skeleton
All Base Classes: Poco::RefCountedObject, Poco::RemotingNG::AttributedObject, Poco::RemotingNG::Skeleton
Member Summary
Member Functions: remoting__typeId
Inherited Functions: addMethodHandler, clearAttributes, countAttributes, duplicate, enumerateAttributes, getAttribute, hasAttribute, invoke, operator =, referenceCount, release, removeAttribute, setAttribute
Constructors
ModbusMasterSkeleton
Creates a ModbusMasterSkeleton.
Destructor
~ModbusMasterSkeleton
virtual ~ModbusMasterSkeleton();
Destroys a ModbusMasterSkeleton.
Member Functions
remoting__typeId
virtual const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId() const;
Variables
DEFAULT_NS
static const std::string DEFAULT_NS;