Skip to main content
U.S. flag

An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Expressions


An expression is a formula that can be used to define a list of values for a motor or other device. All expressions have a name and can be constructed from values, variables, and/or constants that are manipulated by operators. For example,

Expression Reference Example 1

In the above example, the expression calculates a set of positional values for motorB.softPosition that are twice the set of positional values for motorA.softPosition.

To break it down, motorB.softPosition is the expression name and represents both a node on the system (specifically, the motorB motor device’s software position node, motorB.softPosition) and a set of calculated values. As such, the motorB.softPosition name allows for the set of values to be applied to an actual node in NICE, motorB.softPosition, but also be applied elsewhere, such as in other expressions.

Continuing with the example, we see the formula motorA.softPosition * 2

  • motorA.softPosition is a variable and a device node
  • * is a multiplication operator
  • 2 is a value

Of note, motorA.softPosition is a variable because it is also an expression with a formulated value set that can be subject to change – so if motorA.softPosition’s values change, motorB.softPosition’s values will also change.

In its simplest form, an expression can be a single value.

Expression Reference Example 2

In the above example, the expression calculates a set of positional values for motorB.softPosition with only one value, 16.0 – as such, motorB.softPosition will always be set to 16.0.

Values in an expression can also be received from a function (see Functions). The entirety of an expression might simply be calling a function that was created in Init – or it might be calling a function and then operating on the returned value with other values, variables, and/or constants.

Created December 7, 2018, Updated December 12, 2018