Embedded Sequences

Synnax’s embedded sequence editor allows you to write, test, and run tightly controlled automations directly within the Synnax Console.

Synnax’s control sequences are written in Lua. Lua’s syntax is very simple, and you’ll only need a simple set of keywords for most sequences. Here are some other useful resources for getting started:

ResourceDescription
RecipesA set of common control sequence patterns we see in the field
Reference A complete reference of all keywords and functions available in the sequence editor

Creating a New Sequence

There are two ways to create a new control sequence. The first is by creating a new component through the Synnax mosaic and choosing “Control Sequence” as the component type:

Control sequences can also be created through the command palette, which you can open using `Cmd + Shift + P’ on macOS and ‘Ctrl + Shift + P’ on Windows.

Structure of a Sequence

Once you’ve created a sequence, you’ll see a large area for editing text at the top and a set of configuration fields at the bottom.

The Editor

The editing area at the top of the dialog is where you’ll write the body of your sequence, including conditional logic. Embedded control sequences are executed in precisely timed, fixed rate loops.

If you set the sequence rate to 1 Hz, the code you write inside of this editor will be executed once every second, even if the previous loop did not complete

Configuration Parameters

In addition to the main sequence body, there are a number of important fields for configuring sequence parameters.

Location

This sets the driver that the sequence will be executed on.

Rate

This sets the rate, in Hz, at which the sequence will be executed.

Read From

The list of channels that we need to read values from in order to make control decisions from our sequence. An example could be a set of pressure transducers to determine when to open and close a valve.

As you edit code within the body of the sequence, Synnax will suggest channels that match the variable you’re typing. If you choose to accept the suggestion, it will be automatically populated into this field.

Write To

The list of channels that you would like to control within your sequence. For example, these could be digital output channels that actuate a valve.