CHAPTER 2 APPLICATION OF PROGRAMMING
CHAPTER 2 APPLICATION OF PROGRAMMING
2.1 Memory and Files 2
2.1.1 Memory configuration and storable data
Memory configuration differs depending on the CPU module (refer to the following).
CPU module Memory configuration
Q00UJCPU Program memory, standard ROM
Q00UCPU, Q01UCPU Program memory, standard RAM, standard ROM
Program memory, standard RAM, standard ROM, memory card
Q02UCPU, QnUD(H)CPU, QnUDE(H)CPU
(SRAM card, Flash card, or ATA card)
QnUDVCPU, QnUDPVCPU Program memory, standard RAM, standard ROM, SD memory card
(1) Program memory
This memory stores programs and parameters required in processing of the CPU module.
(a) Processing a program
When a program is executed, data in the program memory are transferred to the program cache memory*1 at
the following timings.
• Initial processing at power-on
2.1.1 Memory configuration and storable data
2.1 Memory and Files
• Initial processing at reset
*1 The program cache memory is used for program operations.
(b) Writing to the program memory
When a program is written to the program memory, it is temporarily written to the program cache memory, and
then automatically transferred back to the program memory.
While the CPU module is in the RUN status, automatic data transfer to the program memory can be disabled by setting.
( Page 173, Section 3.12.3)
35
(c) Transfer confirmation to the program memory
Program transfer to the program memory can be checked by the following.
• Checking the status in the progress screen
The following figure is the progress screen in a programming tool.
• Checking with the special relay and the special register
The status can be checked using SM681 and SD681.
(d) Checking whether data are transferred to the program memory Note 2.1 Note 2.1
Whether data are transferred from the program cache memory to the program memory can be checked using
SM165.
(2) Standard RAM
This memory stores file register files, local device files, sampling trace files, and module error history files.
For the High-speed Universal model QCPU and Universal model Process CPU, the size of standard RAM is
extended by installing an extended SRAM cassette.
(3) Standard ROM
This memory stores data such as device comments and PLC user data.
Note 2.1
When checking the data transfer status with the Q02UCPU, Q03UDCPU, Q04UDHCPU, or Q06UDHCPU, check the ver-
sions of the CPU module and programming tool used. ( Page 466, Appendix 2)
36
CHAPTER 2 APPLICATION OF PROGRAMMING
(4) Memory card
This memory is used to extend memory in a CPU module. Three types of memory cards are applicable.
• SRAM card
• Flash card 2
• ATA card
(a) SRAM card
Data can be read from or written to a file register file stored in an SRAM card by sequence programs.
This card is used when:
• the number of file register points is greater than the standard RAM capacity, or
• the sampling trace function is used. ( Page 184, Section 3.14)
When storing file registers to the SRAM card, the file registers can be written or read by the sequence program
up to 4086K points.
(b) Flash card
This card is used when changing data is not required. Data are written to the card using a programming tool
and read from the card by sequence programs. (Data cannot be written to the card by sequence programs.) Up
to 2039K points of file register data can be stored.
(c) ATA card
This card is used for PLC user data (general-purpose data).
With the file access instruction (such as the SP. FWRITE instruction) in the sequence program, access the PLC
user data in the ATA card in CSV format/binary format.
(5) SD memory card
2.1.1 Memory configuration and storable data
2.1 Memory and Files
This memory stores programs and parameters. To execute programs stored in an SD memory card, perform boot
operation. ( Page 104, Section 2.11) To execute the data logging function, this card must be inserted.
37
(6) Memory capacities and necessity of formatting
The following tables list the memory capacities and necessity of formatting of each memory.
Format a memory that requires formatting using a programming tool before use.
Memory Q03UD/Q03 Q04UDH/Q0 Q06UDH/Q0
Q00UJCPU Q00UCPU Q01UCPU Q02UCPU Formatting
device UDECPU 4UDEHCPU 6UDEHCPU
40K bytes 40K bytes 60K bytes 80K bytes 120K bytes 160K bytes 240K bytes
Program memory Necessary
(10K steps) (10K steps) (15K steps) (20K steps) (30K steps) (40K steps) (60K steps)
Standard ROM 256K bytes 512K bytes 512K bytes 512K bytes 1024K bytes 1024K bytes 1024K bytes Unnecessary
Standard RAM - 128K bytes 128K bytes 128K bytes 192K bytes 256K bytes 768K bytes Necessary*1
Q2MEM-1MBSN, Q2MEM-1MBS: 1M byte
SRAM Q2MEM-2MBSN, Q2MEM-2MBS: 2M bytes
- Necessary
card Q3MEM-4MBS: 4M bytes
Q3MEM-8MBS: 8M bytes
Memory
Flash Q2MEM-2MBF: 2M bytes
card - Unnecessary
card Q2MEM-4MBF: 4M bytes
Q2MEM-8MBA: 8M bytes
ATA
- Q2MEM-16MBA: 16M bytes Necessary
card
Q2MEM-32MBA: 32M bytes
Memory Q10UDH/Q10 Q13UDH/Q13 Q20UDH/Q20 Q26UDH/Q26
Q50UDEHCPU Q100UDEHCPU Formatting
device UDEHCPU UDEHCPU UDEHCPU UDEHCPU
400K bytes 520K bytes 800K bytes 1040K bytes 2000K bytes 4000K bytes
Program memory Necessary
(100K steps) (130K steps) (200K steps) (260K steps) (500K steps) (1000K steps)
Standard ROM 2048K bytes 2048K bytes 4096K bytes 4096K bytes 8192K bytes 16384K bytes Unnecessary
Standard RAM 1024K bytes 1024K bytes 1280K bytes 1280K bytes 1536K bytes 1792K bytes Necessary*1
Q2MEM-1MBSN, Q2MEM-1MBS: 1M byte
SRAM Q2MEM-2MBSN, Q2MEM-2MBS: 2M bytes
Necessary
card Q3MEM-4MBS: 4M bytes
Q3MEM-8MBS: 8M bytes
Memory
Flash Q2MEM-2MBF: 2M bytes
card Unnecessary
card Q2MEM-4MBF: 4M bytes
Q2MEM-8MBA: 8M bytes
ATA
Q2MEM-16MBA: 16M bytes Necessary
card
Q2MEM-32MBA: 32M bytes
38
CHAPTER 2 APPLICATION OF PROGRAMMING
Q04UDVCPU/ Q06UDVCPU/ Q13UDVCPU/ Q26UDVCPU/
Memory device Q03UDVCPU Formatting
Q04UDPVCPU Q06UDPVCPU Q13UDPVCPU Q26UDPVCPU
120K bytes 160K bytes 240K bytes 520K bytes 1040K bytes
Program memory Necessary
(30K steps) (40K steps) (60K steps) (130K steps) (260K steps)
Standard ROM
Standard RAM*2 192K bytes
1025.5K bytes
256K bytes 768K bytes
2051K bytes
1024K bytes
4102K bytes
1280K bytes
Unnecessary
2
With an extended
1216K bytes 1280K bytes 1792K bytes 2048K bytes 2304K bytes
SRAM cassette (1M)
With an extended
2240K bytes 2304K bytes 2816K bytes 3072K bytes 3328K bytes
SRAM cassette (2M) Necessary*1
With an extended
4288K bytes 4352K bytes 4864K bytes 5120K bytes 5376K bytes
SRAM cassette (4M)
With an extended
8384K bytes 8448K bytes 8960K bytes 9216K bytes 9472K bytes
SRAM cassette (8M)
SD memory card Capacity of the SD memory card used Necessary
*1 When the memory contents become indefinite in initial status or due to the end of battery life, the memory is
automatically formatted after the CPU module is powered off and then on or is reset.
*2 This is the capacity when an extended SRAM cassette is not used.
When files are written to each memory, the unit of stored file size depends on the target CPU module and memory area.
( Page 50, Section 2.1.3 (4))
In memory capacity calculation, 1 step is equal to 4 bytes.
2.1.1 Memory configuration and storable data
2.1 Memory and Files
39
(7) Memory and data to be stored
The following table lists data that can be stored in each memory.
:Required, :Storable, × :Not storable
Memory Memory card Memory
CPU module built-in memory
card (RAM) (ROM) card (SD)
Program Standard Standard Flash ATA SD memory File name and
Item SRAM card Remarks
memory RAM ROM card card card extension
Drive 0*1 Drive 3*1 Drive 4*1 Drive 1*1 Drive 2*1 Drive 2*1
Parameter *14 [Link] 1 data/drive
Intelligent function
*14 [Link] 1 data/drive
module parameter*2
Program *14 *3 *4 *4 *4 *4 ***.QPG -
Device comment *5 *14 *6 *6 *6 *6 *6 ***.QCD -
Initial device value *14 ***.QDI -
File register × *7*8 × *9 × × ***.QDR -
1 data/CPU
Local device × *7 × × × × ***.QDL
module
Sampling trace file × *7 × × × × ***.QTD -
Device data storage
× × × × × × [Link] -
file
Module error
× *7 × × × × × [Link] -
collection file
Boot setting file *14 [Link] -
Remote password *14 [Link] -
Latch data backup
× × × × × × [Link] -
file
Backup data file × × × [Link] -
[Link],
Data logging setting
× × × × × [Link] to -
file [Link]
Data logging file × × *13 × × × ***.CSV -
PLC user data × × × × *10 *10 ***.CSV/BIN -
Symbolic
*14 × *12 -
information*11
Drive heading *14 [Link] -
System file for the iQ
Sensor Solution
× × × × × × [Link] -
function (data
backup/restoration)
Backup data file for
the iQ Sensor
Solution function × × × × × × ***.QBR *15 -
(data
backup/restoration)
Predefined protocol
× × × × × [Link] -
setting file
40
CHAPTER 2 APPLICATION OF PROGRAMMING
Memory Memory card Memory
CPU module built-in memory
card (RAM) (ROM) card (SD)
Program Standard Standard Flash ATA SD memory File name and
Item SRAM card Remarks
memory RAM ROM card card card extension
Drive 0*1 Drive 3*1 Drive 4*1 Drive 1*1 Drive 2*1 Drive 2*1 2
System information
file for CPU module
× × × × × × [Link] -
data
backup/restoration
System data file for
CPU module data × × × × × × [Link] -
backup/restoration
Device data file for
CPU module data × × × × × × [Link] -
backup/restoration
Operation history file × × × × × [Link] -
*1 A drive number is used to specify memory where data are written or read by external devices using a sequence program or
MC protocol. Since memory names are used to specify memory using a programming tool, drive numbers do not need to be
considered.
*2 Store the intelligent function module parameters in the same drive with the parameters. The intelligent function module
parameters stored in a different drive are not valid.
*3 A program stored in the standard ROM cannot be executed. Store the program to the program memory before
execution.
*4 To execute a program stored in a memory card or SD memory card, make the setting in the Boot file tab of the PLC
parameter dialog box.
*5 The device comments cannot be read by instructions in a sequence program.
*6 Several scans are required to read device comments using a sequence program.
*7 CPU modules other than the High-speed Universal model QCPU and Universal model Process CPU store only one file
for each item. The High-speed Universal model QCPU and Universal model Process CPU store more than one file for
2.1.1 Memory configuration and storable data
2.1 Memory and Files
each item.
*8 For the number of storable file register points, refer to Page 392, Section 4.7.
*9 A sequence program allows reading only. No data can be written from the sequence program.
*10 Data can be written or read with the following instructions.
•[Link] (batch-reads data from the specified file in the memory card.)
•[Link] (batch-writes data to the specified file in the memory card.)
*11 This is the data in which the information of label program configuration is stored.
GX Works2 Version 1 Operating Manual (Common)
*12 CPU modules other than the High-speed Universal model QCPU and Universal model Process CPU: The file name and
extension will be [Link] or [Link] for Simple projects (with a label), and [Link] or
[Link] for Structured projects.
High-speed Universal model QCPU and Universal model Process CPU: The file name and extension will be
SRCINF1M.C32 or SRCINF2M.C32 for Simple projects (with a label), and SRCINF1I.C32 or SRCINF2I.C32 for
Structured projects.
*13 This file cannot be specified as a data storage file when the data logging function is used. To write data to the file,
execute the write PLC user data function.
*14 Only the High-speed Universal model QCPU and Universal model Process CPU can store these data in the memory.
*15 This file name depends on the connection type of the iQ Sensor Solution data backup/restoration function. ( iQ
Sensor Solution Reference Manual)
For methods for writing data to each memory (online operation), refer to the following.
Manual for the programming tool used
41
2.1.2 Parameter-valid drive
CPU modules operate according to parameter settings. Systems automatically select parameters from those stored in
the drives for CPU module operation, according to the following priority order. A user does not have to select them.
(1) Priority of the parameter-valid drives
The CPU module operates according to parameters stored in a higher priority drive.
• Q00U(J)CPU, Q01UCPU
Priority Drive where parameters are stored
High 1 Drive 0 (program memory)
2 Drive 4 (standard ROM)
Low
• Q02UCPU, QnUD(H)CPU, QnUDE(H)CPU
Priority Drive where parameters are stored
High 1 Drive 0 (program memory)
2 Drive 1 (memory card RAM)
3 Drive 2 (memory card ROM)
Low 4 Drive 4 (standard ROM)
• QnUDVCPU, QnUDPVCPU
Priority Drive where parameters are stored
1 Drive 0 (program memory)
High
2 Drive 2 (memory card SD)*1
3 Drive 3 (standard RAM)
Low
4 Drive 4 (standard ROM)
*1 When the CPU module is locked with a security key and parameters are stored in a memory card (SD) (no parameters
stored in the program memory), "MISSING PARA" (error code: 2200) occurs.
If a parameter file with a boot setting exists in a memory card or SD memory card, the file will be transferred according to
the setting. If the transfer target memory is set to the program memory, the file will be transferred to the program cache
memory as well.
To check the parameter file that the CPU module uses, see "Parameter Valid Drive Information" of "PLC Status
Information" on the PLC Diagnostics window. ( Page 466, Appendix 2)
[Diagnostics] [PLC Diagnostics]
42
CHAPTER 2 APPLICATION OF PROGRAMMING
(2) When to determine valid parameters
The CPU module automatically searches for parameters in the following timing and operates by the settings of
the parameters stored in the drives:
• the CPU module is powered off and then on, or 2
• it is reset.
When storing parameters to a drive by executing the write to PLC function from a programming tool, the timing for
validating the parameters differs depending on the drive.
(a) When parameters are stored to the drive different from the one that stores the
parameters in operation
The parameters are validated according to the priority set to the drive after the CPU module is powered off and
then on or is reset.
(b) When parameters are stored to the drive same as the one that stores the parameters
in operation
Only the setting made in the Device tab of the PLC parameter dialog box is validated after “Write to PLC” is
performed.
To validate all parameter settings, power off and then on or reset the CPU module.
2.1.2 Parameter-valid drive
2.1 Memory and Files
43