6 Programming
6-4
NJ-series CPU Unit Software User’s Manual (W501)
POU (Program Organization Unit) Design Reference
Determine which processes to put into which POUs and design
the POUs.
Note Functions cannot contain function block instructions or function blocks.
6-2 POUs (Pro-
gram Organiza-
tion Units)
Determine which languages, such as ladder diagrams, inline
ST, and ST, to use to create each process.
Note Inline ST is structured text that is written as an element of a ladder diagram.
6-5 Program-
ming Lan-
guages
Variable Design Reference
Design the user-defined variables that you need to create.
6-3-1 Variables
6-3-2 Types of
Variables
Separate variables into those that you use in more than one
POU (global variables) and variables that you use in only
specific POUs (local variables).
6-3-3 Types of
User-defined
Variables in
Respect to
POUs
Determine if you need to automatically generate the variable
names for the device variables that you use to access slaves
and Units or if you need to define them yourself.
3-3 I/O Ports
and Device
Variables
Design the attributes for the variables.
Variable Name, Data Type, AT Specification, Initial Value, Retain, Constant, and Network
Publish
Decide the data types of your variables (including array specifications, range specifications,
structures, and enumerations).
6-3-4 Attributes
of Variables
6-3-5 Data
Ty pe s
6-3-6 Deriva-
tive Data Types
Keep the following precautions in mind when you design
variables.
• Retention:
Set the Retain attributes to determine the values that are used for variables when the power
supply is turned ON or when the operating mode changes.
• Structures:
When a structure is used for a variable in an instruction, design the program to use the same
structure data type for the input parameter, output parameter, or in-out parameter.
Example: Communications Instructions
• Array Specifications:
When an array variable is used for the variable for an instruction, design the program to use
an array variable for the input parameter, output parameter, or in-out parameter.
Examples: Shift Instructions, Stack Instructions, and Table Instructions
• AT Specifications:
Use AT specifications for the variables used for input parameters to certain instructions.
Example: Fixed or user I/O allocations for DeviceNet Units
• Network Publishing:
Design the variables for EtherNet/IP tag data links.
6-3-4 Attributes
of Variables
6-3-5 Data
Ty pe s
6-3-6 Deriva-
tive Data Types