Delta Electronics AH — 2.4.4 Using instructions, Devices and Symbols

Chapter 2 Devices, Symbols and Instructions 2_ 2.4.4 Using instructions, Devices and Symbols A device is assigned to a symbol according to the data type of the symbol. You can set the initial value of a symbol. After the program in a project is downloaded to a motion controller, the initial values of the symbols will be written into the devices assigned to the symbols if the program is scanned for the first time. The principles of assigning devices to symbols are as follows.  You can assign devices to the global symbols and the local symbols declared in the POUs which are programs.

The system can also automatically assign devices to the global symbols and the local symbols declared in the POUs which are programs.  If a local symbol declared in a function block is not a symbol of the VAR class, the system will automatically assign a device to the symbol, and you can not assign a device to the symbol.  The devices assigned by the system are usable devices. (You can set a range of devices which can be assigned automatically.)  If a symbol is declared, the device assigned to the symbol, the data type of the symbol, and the initial value of the symbol must be compatible with one another.

The relation between the data types and the device types which can be assigned is described below. 2-17 Data type Name Description Program Function block REAL Real numbers. 32-bit data; applicable to single width floating-point instructions.   LREAL Long reals 64-bit data; applicable to double width floating-point instructions.   CNT Counter 16-bit counter value or 32-bit counter value.   TMR Timer 16-bit timer value.   ARRAY Array If a symbol is declared as an array, the size of an array and an array data type must be specified.

(An array is composed of 256 elements/members at most.)   String Character string Variable-length single-byte data string   Data type AH Motion Controller CPU Device assigned by users Device assigned by the system BOOL Contact M/SM or bit in the device X/Y (*3) Contact M/SM WORD D W DWORD D W LWORD D W