beautypg.com

Delta RMC151 User Manual

Page 860

background image

RMC70/150 and RMCTools User Manual

// Position plus 2.56.

_Axis[0].PosOffset

:=

_Axis[0].ActPos

+ 2.56;

// Calculate 6 plus half the minimum of the first two axes current Actual
// positions. Save this in SampleVariable.

SampleVariable

:=

Min(

_Axis[0].ActPos

,

_Axis[1].ActPos

)

/ 2.0 + 6.0;



Example 3
An IF statement.

IF

_Axis[0].StatusBits.InPos

=

True

THEN

MyREAL1

:= 34.0;

MyREAL2

:= 70023.0;

ELSEIF

ABS

(

_Axis[0].ActPos

) > 20.0

THEN

%QX0.1

:=

True

;

ELSE

MyDINT

:= 2;

END_IF



Example 4
A COPY function. The variable i must be a DINT.

COPY

(

MyArray

[0],

MyOtherArray

[

i

],20);



Example 5
Commenting a large section of code. You may wish to comment out a large section of

code temporarily during development. The commented text will not be executed.

IF

_Axis[0].StatusBits.InPos

=

True

THEN

MyREAL1

:= 34.0;

MyREAL2

:= 70023.0;

(*
ELSEIF ABS(_Axis[0].ActPos) > 20.0 THEN

%QX0.1 := True;
*)

ELSE

MyDINT

:= 2;

END_IF

Entering an Expression

Choose the Expression (113) command in a step in the User Program.

Double-click the Expression parameter box. The Expression Builder will open.

840

Delta Computer Systems, Inc.

This manual is related to the following products: