Value Expressions

A value expression evaluates to a number. Value expressions are used in the Delay Link Type, in command parameters in user programs, and to programmatically select commanded axes in user programs.

Value expressions can be very simple, for example just a tag name, such as Axis[1].ActPos.

Sample Expressions

Example 1

 

MyPosition + 10

 

Note: MyPosition must exist as a variable.

Example 2

 

_Axis[1].ActPrs - _Axis[0].ActPrs

 

Example 3

 

3.0 + ABS(_Axis[].ActPos);

 

 

Entering an Expression

Delay Link Type

  1. In the Delay Link Type, double-click the Time to Delay box. The Expression Editor will open.

  2. Enter the expression:

  1. Click OK to close the dialog and enter the expression in the command.

Command Parameters

  1. In a command parameter in a user program, double-click the box.
    Notice that the Expression Editor is not available when entering expressions in command parameters. it is good practice to only use short expressions in Command Parameters. If you need a long expression in a command parameter, consider creating a variable instead that is calculated in an expression command, and then entered in the command parameter.

  2. Enter the expression:

  1. Press Enter to finish editing. If the expression is invalid, the entire expression text will be red. When the entire expression is in black text, the expression is valid.

 

See Also

Expressions Overview | Constants | Functions | Operators | If Statement | Keywords


Send comments on this topic.

Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion