Breakout Board Digital Outputs
The following excerpt from the breakout board example workflow demonstrates digital outputs functionality by computing a ~10Hz binary digital counter and outputting that counter to the digital output port.
The Timer operator generates a sequence
of 64-bit signed integers
in ~100ms intervals. The Int
operator emits an integer (with a value of 1 in our case) when an item is received from the upstream
sequence. The Accumulate operator
increments a value by the values of items in its upstream sequence. The Accumulate
operator emits
this value when an item is received from the upstream sequence.
The DigitalOutput operator updates the digital output part when sends data in
the sequence computed by the upstream operators to update the digital output port. The digital
outputs are updated when an item is received from the upstream sequence. Although Accumulate
produces a 32-bit integer that counts from 0 to 2147483647, the DigitalOutput
operator only uses
the lower 8-bits to update the digital output state. In the Breakout Board example workflow, the
DigitalOutput
's DeviceName
property to "BreakoutBoard/DigitalOutput". This links the
DigitalOutput
operator to the corresponding configuration operator.