What is a variable

A variable represents one value communicated with a device in real time — e.g. engine speed, a temperature, or a status word. Variables are the center of the whole project: drivers and protocols feed them with data, Controls display them, the logger records them, and scripts work with them.

Variable properties

  • Id — a numeric identifier within the project,
  • Namespace and Name — the namespace and name (the name is also used as the default identifier in the protocol),
  • Label and Description — a caption and an optional description,
  • Data Type — the value data type (Byte, Short, Int, Long and their unsigned variants, Float, Double, String),
  • Length — the length for value arrays (1 for a regular scalar variable),
  • Presentation — a reference to the presentation that defines how the value is displayed.

Raw and engineering value

A variable holds the raw value — exactly what arrived from the device (e.g. a 16-bit number from a CAN message). For display, the raw value is recalculated by a conversion into an engineering value in physical units (e.g. 4000 → 40.0 °C). How the result is formatted and which unit is shown is defined by the presentation.

When a variable is communicated

When the value is exchanged with the device is decided by the event chosen when connecting the variable to a protocol:

  • Periodic — regularly with a given period,
  • OnValueChanged — when the value changes (with a threshold),
  • OnRequest — on demand.

Events are defined in Home → Project Configuration → Events and are shared by the whole project — several variables can share one period.

Next

Before creating a variable, prepare its conversion and presentation — the variable references them, which is why they are created first.