CDPSignalChannel Class
(ServerIO::CDPSignalChannel)The CDPSignalChannel template-class is an ACDPBaseChannel<> implementation based on CDPSignal. More...
| Header: | #include <CDPSignalChannel> |
Detailed Description
The CDPSignalChannel template-class is an ACDPBaseChannel<> implementation based on CDPSignal.
This class is final and IChannel interface members are threadsafe for user threads that run SynchronizeValuesIn() and SynchronizeValuesOut() through ChannelManager.
CDPSignalChannel<string> Specialization
CDPSignalChannel<string> has an additional member BinaryEncodedLength that can be specified to limit the size of the string. When BinaryEncodedLength is set to 0, the channel will behave as a dynamically sized channel, and automatically resize to match the content size.
When BinaryEncodedLength is set to a non-zero value, then the channel will be always encoded to that size, so that longer string values will be truncated and shorter values will be padded by zero characters. This can be useful in some I/O Servers, such as ModbusIO, to send and receive string data that always occupies a fixed amount of space.
Note: Some I/O Servers, such as ModbusIO can not fully handle dynamically sized channels (i.e. BinaryEncodedLength set to 0) as it will cause issues due to the string length and positioning of the data in the channels following this string channel.
Note: Custom buffer can be passed to the channel using ACDPBaseChannel::SetDataPointer(). Passing in 'nullptr' as a data pointer will make the CDPSignalChannel<string> use the internal buffer.
See also CDPSignalChannelFactory::CreateCDPSignalChannel, IOServer, ServerIO, ServerIO::ACDPBaseChannel, ServerIO::ICDPChannel, ServerIO::IChannel, ServerIO::CDPPropertyChannel, and ServerIO::ComponentStateChannel.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.