Omron NB Series Operation Manual page 298

Nb-series programmable terminals
Hide thumbs Also See for NB Series:
Table of Contents

Advertisement

Here, select "signed int." from "Data Type", "Read" from "R/W", "LW" from "Address Type" and "0" from
"Address" respectively. After the selection, click the "OK" button, then this variable will be seen in
"Parameters [macro_0.c]" window.
Note When the Macrocode being written, all the external data referenced must be pre-registered in "Parameters
[macro_0.c]" window.
Set LW1_R and make its address to LW1, then set the address of LW2_W to LW2 by the same method.
Note When the Data Type is set to "double", the Word Length will automatically become 4, i.e. this variable will
occupy LW2 to LW5.
After the completion of setup, the "Parameters [macro_0.c]" window is shown as below:
After defining the variables, we should write the following Macrocode:
int MacroEntry()
{
//LW0 is divided by LW1and LW2 is obtained
LW2_W=LW0_R/LW1_R;
return 0;
}
Once it is saved, the simple Macro is completed. At this time, go to the HMI Edit Screen to make the
editions as shown below:
Place 2 Number Input components corresponding to LW0 and LW1 respectively;
Place 1 static text, and input "/" to represent "division";
Place 1 Number Display component corresponding to LW2, and set the Data Type to "double" (i.e.
double-precision floating-point) and both the Integer and Decimal to "4";
Place 1 Function Key to execute Macro, and select "macro_0.c" in the drop-down menu and input "="
in the tag, as shown below:
NB-series Programmable Terminals NB-Designer Operation Manual(V106)
3 Functions of NB-Designer
3
3-257

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents