beautypg.com

Pm designer operation manual – B&B Electronics WOP-2121V-N4AE - Manual User Manual

Page 430

background image

4

14

PM Designer Operation Manual

14-21

CHAPTER 14 USING MACROS

EXTRACT_BIT

Format

P1

= EXTRACT_BIT(P2,P3)

Data Type

U/UD

Function

Extracts bit P3 from P2 and saves the result in P1.

P1 (I)

The bit to save the result.

P2 (I)

The location to extract the bit.

P3 (I/C)

The number of the bit to be extracted.

Example 1

$U2.0

= EXTRACT_BIT(

$U10

,

31

) (UD)

/* Extract bit 31 of the double word $U10 and save the

result in $U2.0 */

14.4.7. Conditional Operation

IF ==

Format

IF P2 == P3

Data Type

U/S/UD/SD/F

Function

Executes the commands in the command block following this IF command when P2 is equal to
P3.

P2,P3 (I/E/C/AE) The

operands.

IF !=

Format

IF P2 != P3

Data Type

U/S/UD/SD/F

Function

Executes the commands in the command block following this IF command when P2 is not equal
to P3.

P2,P3 (I/E/C/AE) The

operands.

IF >

Format

IF P2 > P3

Data Type

U/S/UD/SD/F

Function

Executes the commands in the command block following this IF command when P2 is greater
than P3.

P2,P3 (I/E/C/AE) The

operands.

IF >=

Format

IF P2 >= P3

Data Type

U/S/UD/SD/F

Function

Executes the commands in the command block following this IF command when P2 is greater
than or equal to P3.

P2,P3 (I/E/C/AE) The

operands.

IF <

Format

IF P2 < P3

Data Type

U/S/UD/SD/F

Function

Executes the commands in the command block following this IF command when P2 is less than
P3.

P2,P3 (I/E/C/AE) The

operands.