Macro Function; Create A Simple Macro Program - Omron NB-series Operation Manual

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

Advertisement

3 Functions of NB-Designer
3-9

Macro Function

Macro is the function allows the user to create and execute the simple and original programs.
The user can add the functions such a arithmetical operations or discriminant of the conditions which
are not be supported by the basic functions of the NB-Designer. Using the Macro function, the user also
convert the display processing in the screen or the data processing used to be performed in the PLC.
This function allows the PC loading reduced. The Macro of the NB-Designer conforms to C Language
(ANSI C89).
3-9-1

Create a Simple Macro Program

This section provides a brief of the Macro variables.
The Macro variables are classified into two types such as internal variables and external variables.
• Internal variables: The variables are available only within the Macro Program. The internal variables
• External variables: The variables are to read and write the values with the external controllers. The
Storage Format of the variables used in the [Macro Variables Table]
Storage Format
Bit
Signed short
Unsigned short
Signed int
Unsigned int
Float
Double
Read/Write type of Macrocode Variable
Read/Write Type
Read
Write
Read/Write
3-260
can be defined in the [Macro Variable Table] or the [Macro Editing Window].
external variables are necessary to be defined in the [Macro Variable Table] in
advance. The defined external variables can be used in the [Macro Editing Win-
dow].
Data length
1bit
Bit variable with 2 statuses of 0 and 1.
1 word (16 bits)
Signed short-integer variable with a range of -32768 to 32767.
1 word (16 bits)
Unsigned short-integer variable with a range of 0 to 65535.
2 word (32 bits)
Signed-integer variable with a range of -2147483648 to
2147483647.
2 word (32 bits)
Unsigned-integer variable with a range of 0 to 4294967295.
2 word (32 bits)
Single-precision floating-point variable with a range of
-3.4E+38 to +3.4E38
4 word (64 bits)
Double-precision floating-point variable with a range of
-1.79E+308 to +1.79E+308
The values of Macro are read before being executed, and reading operation is not
performed during Macrocode execution.
The values of Macro are written to the specified variable at one time after being
executed, and writing operation is not performed during Macrocode execution.
The values of Macro are read before being executed, and written after being executed.
NB-series Programmable Terminals NB-Designer Operation Manual(V106)
Descriptions
Descriptions

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents