Siemens A31003-51730-U103-7619 user manual Example of a condition with several elements, Functions

Models: A31003-51730-U103-7619

1 336
Download 336 pages 29.09 Kb
Page 160
Image 160
Example of a condition with several elements

The Elements of a DCO-Script

Functions

Example of a condition with several elements

((($BT$ AND (CHECKBOX)CB) OR !$BOOL_VAR$) AND ( $RTS$ EQL %%CONST%%)) AND ( $RTR$ EQL 'OTHER')

Constant (here: CONST)

Negation

Control element Checkbox (here: CB)

Logical connection (here: AND)

Variable (here: BT)

Fixed test

>Before the Functions are executed, a copy is made of the content of each Variable that is used in a condition.

If a Variable is edited within the Functions, the changes will only enter into effect when the conditions are verified again during the next execution of the Functions. This does not apply to Functions that are invoked with the command „The Instruction "Call"“.

Example:

A Button has the Functions func_1 and func_2. In addition, a Variable Number was created with type int and the initial value 2.

The Function func_1 has the condition ($Number$ EQU 2) and the Instructions to set the Variable Number to the value 5.

The Function func_2 has the condition ($Number$ UEQ 2) and the Instructions to set the Variable Number to the value 2.

The user presses the Button and thereby initiates the execution phase.

The Function func_1 is executed. The Function func_2, however, is not performed as the condition is checking a copy of the Variable number which still has the value

2.

When the Button is pressed a second time, the func_2 is executed but the func_1 not as the copy of the Variable number now has the value 5.Note

 

07/2010

5-92

OScAR-Pro Customized Operator, User Manual

Page 160
Image 160
Siemens A31003-51730-U103-7619 user manual Example of a condition with several elements, Functions