Chapter 3 Programming
3
– 18
3.6
Variables
3.6.1 Data memory
In HX-CODESYS programming, external I/Os and data memory (internal registers) are handled as variable names
instead of direct I/O addresses, such like “A1_switch”. If new variable name is used, below Auto Declare window
appears. Enter an each field according to following table.
Item
Descriptions
Scope
Choose “VAR” in normal use. If global variable is used, choose “VAR_GLOBAL”.
Refer to section 3.6.7 Global variable for further information.
Name
Variable name is defined. Refer to section 3.6.3 Available characters for variable names.
Type
Data type is defined. Refer to section 3.6.5 Data type.
Object
In case of local variable, POU name is defined.
Initialization
Initial value when program starting can be set here. If it’s blank, initialization value is 0.
Address
No need to enter I/O address. HX-CODESYS will assign to free address automatically.
Comment
Any text comment can be input.
Flags
CONSTANT
Enter a value in the Initialization field.
RETAIN
The value is maintained by a battery after switch off of the PLC. If new application is
downloaded, it will be initialized. (Refer to section 3.13 Run / Stop / Reset)
PERSISTENT
The value is maintained by a battery after switch off of the PLC. If new application is
downloaded, it will be maintained. (Refer to section 3.13 Run / Stop / Reset)
Bit access
Any bit data in integer type data can be accessed by adding suffix dot and number (decimal 0 to 63).
Example
WORD type (16 bits)
BOOL type (1 bit)
Login display
Содержание EH-A14EDR
Страница 6: ...MEMO ...
Страница 10: ...MEMO ...
Страница 141: ...Chapter 3 Programming 3 81 Program ...
Страница 166: ...Chapter 5 Maintenance 5 4 MEMO ...
Страница 170: ...Appendix A1 4 MEMO ...