Control Sequences
Get started with control sequences in Synnax.
Control sequences are the primary means for automating hardware operations in your Synnax deployment. They provide a systematic way to control actuators and other mechanisms. On this page, we’ll explore the different types of control sequences available within Synnax.
Control Sequence Types
There are two ways to write control sequences in Synnax: via our Python Client and our Embedded Sequence Editor.
Python control sequences are ideal for complex automations requiring a high degree of customization. Embedded control sequences are simple, but can be run on real-time OSs such as National Instruments cRIOs through our NI Linux Real-Time Driver. Embedded control sequences can be edited and deployed directly from within the Synnax Console.
How Control Sequences Work
Both our Python and embedded sequencing systems use the same conceptual approach to control. Control sequences stream data from a set of input channels, perform some computations, and write data to a set of output channels.
A control sequence is just a process, such as a Python script or a loop, that streams data from a set of input channels, performs some computation, and writes data to a set of output channels.
--- This code block runs 10 times per second.
--- Check if the current pressure is below the threshold.
if pressure < 100 then
--- If so, open the valve.
set("press_vlv_cmd", true)
else
--- Otherwise, close the valve.
set("press_vlv_cmd", false)
end
There is no mention of hardware configuration in this sequence. Parameters like acquisition rates, scaling, and other hardware specific details are kept independent from sequencing mechanisms. This allows for a high degree of flexibility, including the ability to move and change hardware without changing the control sequence algorithms.
Example Deployment
To illustrate how control sequences fit into a larger system, here’s an example Synnax deployment that communicates with National Instruments devices:
Component | Description |
---|---|
NI Analog Read Task | Reads data from the analog input ports of an NI-9205 at a fixed sample rate. Scaling and calibration information is configured within this task. The task pushes scaled values to the Synnax cluster for consumption by the control sequence and console for visualization. |
NI Digital Write Task | Writes to the digital output ports of a
NI-9375 based on commands
sent to the di_X_cmd channels by the control sequence. The task also
communicates the state of the digital outputs to the control sequence via the
di_X_state channels. |
Synnax Cluster | Stores and streams all incoming and outgoing data from the NI devices, control sequences, and Synnax Console. All data will pass through the cluster to travel from one component to another. |
Synnax Console | Displays real-time sensor values and actuator states on line plots. |
Control Sequence | Reads the sensor values from the Analog Read Task and writes commands to the Digital Write Task. |