Omron NJ-series User Manual page 245

Machine automation controller cpu unit software
Hide thumbs Also See for NJ-series:
Table of Contents

Advertisement

6 Programming
 Variables for Which You Can Specify the Retain Attribute
AT specifications are made separately for each variable. Set them for all elements and members of
array, structure, and union variables.
Initial Value
The variable is set to the initial value in the following situations.
• When power is turned ON
• When changing between RUN mode and PROGRAM mode
• When you select the Clear the present value of variables with Retain attribute Check Box, and down-
load the user program
• When a major fault level Controller error occurs
You can set an initial value for a variable in advance so that you do not have to write a program to initial-
ize all of the variables. For example, you can preset data such as a recipe as initial values. You do not
have to set any initial values.
 Types of Variables That Can Have Initial Values
You can set initial values for only some types of variables. A list is provided below.
Type of variable
Global variables
Internal variables
Input variables
Output variables
Return values of functions
In-out variables
External variables
 Enabling an Initial Value
You can specify whether a variable has an initial value when you create the variable.
Initial Value Specified
No Initial Value Specified
The following table shows the variables for which you can set an initial value.
Basic data type variables
Array variables
Structure variables
Union variables
Enumerated variables
POU instances
6-58
Supported.
Not supported.
Initial value
(Blank)
Initial value
None
Type
Arrays
Elements
Structures
Members
Unions
Members
Initial Value
Initial value
Or
3.14
Example
aaa
Supported.
bbb
Supported.
bbb[2]
Not supported.
ddd
Supported.
ddd.xxx
Not supported.
eee
Not supported (initial values are always 0).
eee.word
Initial values are always 0.
ccc
Supported.
instance
Not supported.
NJ-series CPU Unit Software User's Manual (W501)
Enabling an Initial Value

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents