EasyManuals Logo

Omron NB-series User Manual

Omron NB-series
548 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #325 background imageLoading...
Page #325 background image
3-283
3 Functions of NB-Designer
NB-series Programmable Terminals NB-Designer Operation Manual(V106)
3-9 Macro Function
3
3-9-4 Other Descriptions
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.

Table of Contents

Other manuals for Omron NB-series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NB-series and is the answer not in the manual?

Omron NB-series Specifications

General IconGeneral
BrandOmron
ModelNB-series
CategoryTouch terminals
LanguageEnglish

Related product manuals