Work with Outputs
- Last UpdatedMay 22, 2024
- 3 minute read
The following information applies to the functionality of Read/Write and Write Features as well as to the output function of AnalogDevice objects.
If a single set request is made to a destination attribute during a single scan cycle, that value is sent to the destination. During a single scan cycle, though, more than one set request to the same destination is possible. In that case, folding occurs and the last value is sent to the destination.
During a single scan cycle, only the last value requested during a scan cycle is sent to its destination when the object executes. Its status is marked as Pending as it waits for write confirmation from the destination object. All other set requests during that scan cycle are marked as successfully completed.
If one or more new sets are requested during the next scan cycle, then the second scan cycle's value is determined as described in the preceding paragraphs. It is then sent to the destination when the object executes again and the value sent to the destination during the previous scan cycle is marked with successful completion status even if write confirmation is not received.
Within a single scan cycle, data is folded and only the last set requested is sent to the destination, unless buffering is enabled. For example, an {11,24,35,35,22,36,40} sequence of set requests results in a value of 40 being sent to the destination object. All other values result in successful completion status.
The exception to this behavior is when you enable buffering, either on a Galaxy-wide basis or for an individual attribute. For more information, see I/O Feature advanced properties information in The I/O Feature.
Boolean data types are an exception to folding behavior when buffering is not enabled. This allows an unknown user input rate (for example, repeated button pushes) with a consistent object scan rate for outputs, and creates reproducible results.
In this case, a combination of folding as described plus maintenance of a queue of one element deep better meets the expectation of users. To begin with, the first value set after the object is deployed (the default True or False) is always written to its destination.
Subsequently, the following occurs during a single scan cycle: A two-tiered caching scheme of a Value to be Sent and a Next Value to be Sent is implemented. The Value to be Sent is based on data change as compared to the last value sent to the destination object. The Next Value to be Sent is based on data change as compared to the Value to be Sent value.
When the first data change occurs, the new value is cached in the Value to be Sent queue. Folding occurs if the same value is requested again. If another value change occurs, this second value is cached in the Next Value to be Sent queue. Again, folding occurs if the same value is requested again.
The Value to be Sent value is sent during the next scan cycle, and the Next Value to be Sent value is sent during the following scan cycle.
Note: In the case of Boolean data types used in Supervisory sets (sets between ApplicationObjects) or a mixture of Supervisory and User sets during a single scan cycle, the behavior is the same as the other data types.
For Boolean data types and User sets, the following examples apply:
|
Previous |
Scan Cycle |
Value to be Sent |
Next Value |
|---|---|---|---|
|
0 |
1,0,0,1,1 |
1 |
none |
|
1 |
1,0,0,1,1 |
0 |
1 |
|
0 |
1,1,0,0 |
1 |
0 |
|
1 |
1,1,0,0 |
0 |
none |
When the same attribute is extended with an Input extension and an Output extension, writes to the Output extension’s Destination occur every scan regardless of whether the extended attribute has changed.
This behavior occurs even when the Output Every Scan check box is cleared, which may add more network traffic. The behavior does not apply to an Input extension.