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

4
14
PM Designer Operation Manual
14-27
CHAPTER 14 USING MACROS
JMP !
Format
JMP(P1,!P2)
Data Type
B
Function
Jumps to the program point specified by label P1 if the condition P2 is false (0/Off).
P1 (CS)
The label of the program point.
P2,P3 (I/E/CE) The
operands.
CALL
Format
CALL P1
Function
Goes to sub-macro P1.
P1 (Sub-macro
name)
The sub-macro to be called.
Example 1
CALL CommonFunction_01
/* Go to sub-macro named CommonFuncation_01 */
RET
Format
RET
Function
Returns to the calling macro. This command can only be used in sub-macros.
FOR
Format
FOR P2
Data Type
U
Function
Runs the commands within the FOR loop by P1 times. A FOR loop is enclosed by a matching
pair of FOR and NEXT commands. There can be up to 20 nested FOR loops.
P1 (I/C)
Total times to run the FOR loop
Example 1
FOR
10
$U100
=
$U100
+
1
/* This command will be executed 10 times */
FOR
12
$U200
=
$U200
+
1
/* This command will be executed 120 times */
NEXT
NEXT
NEXT
Format
NEXT
Function
This command indicates the end of a FOR loop. It is not an executable command.
Example 1
Example:
$U1
=
10
$U2
=
12
FOR
$U1
$U100
=
$U100
+
1
/* This command will be executed 10 times. */
FOR
$U2
$U200
=
$U200
+
1
/* This command will be executed 120 times. */
NEXT
NEXT