Channel reference
Channel properties, data types, name rules, and error messages.
This page lists the properties of a channel, the data types that it can have, and the errors that channel operations can return.
Properties
- Key
number A number that identifies the channel. Synnax sets the key when you create the channel, and the key never changes. Plots, schematics, and tasks refer to channels by key.
- Name
stringRequired The name of the channel. It must follow the name rules. To change it, rename the channel.
- Data type
stringRequired The type of each sample in the channel. See data types. An index channel always has the
timestampdata type. In Python,is_index=Truesetstimestampfor you.- Is index
boolean = false truefor an index channel. An index channel cannot be virtual.- Index
number The key of the index channel that holds the timestamps of this channel. Each data channel needs an index, and the index must exist before you create the data channel. Leave it unset for index, virtual, and calculated channels.
- Virtual
boolean = false truefor a virtual channel. Synnax streams the values of a virtual channel and does not store them. A calculated channel also hasvirtualset totrue, because Synnax does not store its values.
Calculated channel properties
A calculated channel has a name and the properties
below. Synnax sets its data type, its index, and its virtual property. You can change
all of these properties after you create the channel.
- Expression
stringRequired The Arc expression that computes each value. See write an expression.
- Operations
list of operations The operations that Synnax applies to the result of the expression. The Console sets one operation. The client libraries accept a list, and Synnax applies the operations in order.
Operation properties
- Type
stringRequired min,max,avg,derivative, ornone.- Window
TimeSpan = 0 The time after which
min,max, oravgresets, in seconds in the Console.0never resets.- Reset channel
number = 0 The key of a
booleanchannel.min,max, oravgresets when this channel receivestrue, and0means no reset channel.
Data types
All data types can be stored, and all can be virtual. Only timestamp can be the data
type of an index channel.
Name rules
- A name contains only letters, digits, and underscores.
- A name cannot start with a digit.
- Each name is unique. Names are case-sensitive, so
tank_pressureandTank_pressureare two different names.
An administrator can turn off these rules on a Core with the
--disable-channel-name-validation flag.
Then names can have any characters, and two channels can have the same name.
Errors
Names
- Cause
- Another channel has this name.
- Fix
- Select a different name.
- Cause
- The name does not follow the name rules.
- Fix
- Change the name to follow the name rules.
Indexes
- Cause
- A data channel has no index.
- Fix
- Set its index, or make it virtual.
- Cause
- A virtual channel has an index, or is an index.
- Fix
- Remove the index setting.
- Cause
- The index does not exist.
- Fix
- Create the index channel first.
- Cause
The index setting points to a channel that is not an index channel.
- Fix
- Set the index to an index channel.
Calculated channels
- Cause
- A calculated channel has an index setting.
- Fix
- Remove the index setting. Synnax creates the index.
- Cause
- An expression uses a channel name that does not exist.
- Fix
- Correct the name, or create the channel.
Delete
- Cause
- Data channels use this index.
- Fix
- Delete them first, or in the same call.
- Cause
- A task or a script has the channel open.
- Fix
- Stop the task or the script, then delete the channel.
Find
- Cause
- No channel matches the name or key.
- Fix
- Check the name or key. Names are case-sensitive.