Variable Properties And Variable Usage - Omron WS02-CXPC1-V9 - V9 Operation Manual

Table of Contents

Advertisement

Variables
Array Settings
Initial Value
Retain
Size
1-3-4

Variable Properties and Variable Usage

20
Refer to Variable Definitions in 2-1-2 Function Block Elements for details on
AT settings and 2-5-3 AT Settings for Internal Variables for details on using
AT settings.
A variable can be treated as a single array of data with the same properties.
To convert a variable to an array, specify that it is an array and specify the
maximum number of elements.
This property can be set for internal variables and input-output variables only.
Only one-dimensional arrays are supported by the CX-Programmer Ver. 5.0
and later versions.
• Setting Procedure
Click the Advanced Button, select the Array Variable option, and input the
maximum number of elements.
• When entering an array variable name in the algorithm in a function block
definition, enter the array index number in square brackets after the vari-
able number.
For details on array settings, refer to Variable Definitions in
.
Block Elements
This is the initial value set in a variable before the instance is executed for the
first time. Afterwards, the value may be changed as the instance is executed.
For example, set a boolean (BOOL) variable (bit) to either 1 (TRUE) or 0
(FALSE). Set a WORD variable to a value between 0 and 65,535 (between
0000 and FFFF hex).
If an initial value is not set, the variable will be set to 0. For example, a bool-
ean variable would be 0 (FALSE) and a WORD variable would be 0000 hex.
Select the Retain Option if you want a variable's data to be retained when the
PLC is turned ON again and when the PLC starts operating.
• Setting Procedure
Select the Retain Option.
When a STRING variable is used, the size required to store the text string can
be set to between 1 and 255 characters.
The following table shows which properties must be set, can be set, and can-
not be set, based on the variable usage.
Property
Internals
Name
Must be set.
Data Type
Must be set.
AT (specified
Can be set.
address)
Array specification
Must be set.
Initial Value
Can be set.
Retained
Can be set.
Size
Can be set.
(See note 2.)
(1) The value of the input parameter will be given.
(2) Valid only for STRING variables.
Variable usage
Inputs
Outputs
Must be set.
Must be set.
Must be set.
Must be set.
Cannot be set. Cannot be set. Cannot be set.
Cannot be set. Cannot be set. Must be set.
Cannot be set.
Can be set.
(See note 1.)
Cannot be set.
Can be set.
(See note 1.)
Cannot be set. Cannot be set. Cannot be set.
Section 1-3
2-1-2 Function
In Out
Must be set.
Must be set.
Cannot be set.
Cannot be set.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents