Chapter 16 C The Programming Language 16.1.2 C Environment In AS series PLC, the storage space for C execution codes (ROM) is 64K Bytes, and the available space for variable declaration (RAM) is 8K Bytes. The two storage spaces mentioned above and the space for storing the existing PLC programs are independent with each other. We suggest you pay attention to the remaining space in the Compile Message area once compiling is completed. C programs are written in the C editing workplace of ISPSoft. A C program can be built just by choosing the C language (C) option in the field of Language during the creation of a POU.
In the C editing workspace, only the standard C writing is supported and other high-level syntax like PLC instructions, C++ or Visual C is not supported. The operation in the C editing workspace is similar to that in a common text editor. When editing a C program, directly type characters or modify them following the format of C syntax in the workspace and switch to the next line when you press Enter key of the keyboard. Array, Struct and Point and etc. can be used to make a variable declaration. Please note that the memory for variable declarations is limited. So variable declarations should be made within the memory-allowed range in case of the PLC crash.
A new variable symbol should be added in the C Global Variables table. There are 1000 D devices for the C variables to use. The start address for C variables is set in the C Global Variables option from the context menu to set the start position of the data exchange area. One of D0~D29000 can be table. Right-click C Global Variables and select the Set the start number of C language data exchange area filled as the start address and then the system automatically assigns 1000 consecutive D devices. The device range of the current data exchange area is displayed once the setting is done. 16-3