beautypg.com

Delta RMC151 User Manual

Page 345

background image

5 Programming

Soft Limit Switch , such as comparing whether the Actual Position is greater than a

ceratin value.

Discrete I/O, such as checking if a discrete input is on.

Entering Directly

1. In the Condition box of a Program Trigger or a link type, double-click the Condition

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.

Using Boolean Values in Condition Expressions

To test a boolean value, such as discrete inputs, it can be compared to True or False, or

simply placed by itself, since it is already a boolean value. The two expressions below are

identical:

MyInput1

=

True

OR

MyInput2

=

False

MyInput1

OR NOT

MyInput2

Testing Bits in DWORD Tags

Appending the Bit Number
To test an individual bit in a DWORD tag, append the bit number or bit name to the tag

name. For example:

_Axis[0].Status.TGDone
MyDWORD.0

Bit Masking
Individual bits in DWORD tags can be tested by using bit masking. The New Condition

wizard uses this method for multiple bits. The example below shows how to check if both

bits 0 and 7 are set in the variable MyDWORD. The parentheses must be present. Due to

the order of precedence, the "=" would be evaluated first if the parentheses were not

present.

(

MyDWORD

AND 16#00000081) = 16#00000081

deltamotion.com

325

This manual is related to the following products: