beautypg.com

Value expressions, E value expressions – Delta RMC151 User Manual

Page 346

background image

RMC70/150 and RMCTools User Manual

5.13.4. 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:

Double-click any item in the lists on the Tags, Functions or Operators tabs

to insert into the expression.

Type other items, such as register addresses or numeric values.

To mix data types, you must explicitly convert them. For example, you cannot

directly assign a fractional value to an integer variable. You must use the data

type conversion functions.

If you enter multiple expressions in the Expression command, each expression

must end with a semi-colon. See the examples below.

If the expression is invalid, the Expression Builder give an error. When no

errors are listed, the expression is valid.

3. 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:

326

Delta Computer Systems, Inc.

This manual is related to the following products: