xentara-plugin v2.0.3
The Xentara Plugin Framework
Loading...
Searching...
No Matches
Writing I/O Skills
See also
Writing Plugin Skills in the Xentara user manual
Data Points in the Xentara user manual

Many Xentara skills provide I/O functionality for I/O hardware, or for virtual I/O components, like simulation components. These types of skills should follow certain conventions, to make them more easily usable with other Xentara components, like data points.

Device and Communication Bus Elements

See also
I/O Components in the Xentara user manual

An element representing a device, a communication bus, or a similar component should follow the following conventions:

If appropriate, the element shouls publish one or more configuration attribute containing the device or bus address. This attribute can have the standard name available through xentara::model::Attribute::kAddress, if appropriate. A device should also publish an attribute containing the current device status and error status. These attributes should have the standard names available through xentara::model::Attribute::kDeviceStatus and xentara::model::Attribute::kError, respectively.

A connection based device element should publish a task that attempts to reconnect the device if it has been disconnected. See Publishing Tasks on how to publish tasks.

Skill Data Point Elements

An element representing an input or output, or a bidirectional I/O, must be derived from xentara::skill::DataPoint rather than directly from xentara::skill::Element, and must follow the following conventions:

A skill data point that supports the input direction must provide at least three attributes containing information about the skill data points's value. The following attributes must be provided:

A skill data point that only supports the output direction only needs to provide a value attribute with the role xentara::model::Attribute::kValue. Writing to this attribute should write the value to the output. Please note that an I/O that supports both input and output should handle reading and writing the value attribute independently: Writing the value attribute should not automatically update the read value. The read value should always be taken from the underlying device, to give the device the opportunity to reject or modify the value.

A skill data point will usually publish events that signal changes in these attributes. The name of the event should be the same as the name of the attribute. See Publishing Tasks on how to publish events.

A skill data point can also provide additional configuration and status attributes. See Publishing Attributes on how to publish attributes in general, and Publishing Config Parameters as Xentara Attributes on how to publish configuration attributes.

Many skill data points publish a configuration attribute containing the I/O address. This attribute should have the standard name available through xentara::model::Attribute::kAddress. skill data points that support the input direction can also publish an attribute containing the current read error status, and skill data points that support the output direction can publish an attribute containing the last write error. These attribute should have the standard name available through xentara::model::Attribute::kError and xentara::model::Attribute::kWriteError, respectively.

I/O Transactions

See also
I/O Transactions in the Xentara user manual

An element representing a batched I/O command, transaction, poll, query, etc., shouls follow the following conventions:

An I/O transaction should publish an attribute containing the error status of the last execution. This attribute should have the standard name available through xentara::model::Attribute::kError.

An I/O transaction will usually have to be executed to query the values of the associated skill data points. The I/O transaction should publish a task to allow the user to schedule the execution of the transaction in an execution pipeline. See Publishing Tasks on how to publish tasks.