3-283
3 Functions of NB-Designer
NB-series Programmable Terminals NB-Designer Operation Manual(V106)
3-9 Mac
ro F
unc
tion
3
3-9-4 Other Descr
iptions
7
Example of how to use the local variable functions
When the Macro is created as below, the variables read from the value LB100 and LB101 (in
the PT local memory) are written to LB102 and LB103 (in the PT local memory).
The codes are compiled as follows:
Where,
The “buf” is defined as “_Bool”, and it can also be defined as “short” because each bit address
in local LB memories occupies one-word (16 bit) space (but in fact only one bit in each word is
used.)
ReadLocal(“LB”, 100, 2, (void*)buf, 0) indicates that the values read from LB100 and LB101
are written to buf[0] and buf[1], respectively. “2” located in the center of the parenthesis
indicates the number of bit that the LB100 reads.
WriteLocal (“LB”, 102, 2, (void*)buf, 0) indicates that writes the read values to LB102 and
LB103, respectively.
Firstly, add 2 Bit Switch components with addresses of LB100 and LB101, and then add 2 Bit
Lamp components with addresses of LB102 and LB103. Finally, add a Function Key to execute
the Macro.
After the Save and Compile operations are performed, then execute the Macro:
After the LB100 and LB101 are turned ON, when the Macro is executed, you can see the
LB102 and LB103 are turned ON.
Summary of Contents for NB10W-TW01B
Page 4: ......
Page 10: ...Terminology 6 NB series Programmable Terminals NB Designer Operation Manual V106 ...
Page 528: ...8 Web Interface 8 10 NB series Programmable Terminals NB Designer Operation Manual V106 ...
Page 544: ...Appendices A 16 NB series Programmable Terminals NB Designer Operation Manual V106 ...
Page 546: ...Revision 2 NB series Programmable Terminals NB Designer Operation Manual V106 ...
Page 547: ......