The text of a manual · part 19 of 60
SYSMAC CQM1/CPM1/CPM1A/SRM1 Programmable Controllers Programming Manual: SECTION 3 Memory Areas, pages 162 to 169
Pages 162 to 169 of 520, from SYSMAC CQM1/CPM1/CPM1A/SRM1 Programmable Controllers Programming Manual
The original document is the PDF (2.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Omron CQM1-CPU21
Page 162
Using Memory Cassettes (CQM1 Only)
Section
3-5
3-2-4 TR Area When a complex ladder diagram cannot be programmed in mnemonic code just as it is, these bits are used to temporarily store ON/OFF execution conditions at program branches. They are used only for mnemonic code. When programming directly with ladder diagrams using the Ladder Support Software (LSS) or the SYSMAC Support Software (SSS), TR bits are automatically processed for you. The same TR bits cannot be used more than once within the same instruction block, but can be used again in different instruction blocks. The ON/OFF status of TR bits cannot be monitored from a Peripheral Device. Examples showing the use of TR bits in programming are provided on page 169.
3-2-5 HR Area These bits retain their ON/OFF status even after the CPM1/CPM1A power supply has been turned off or when operation begins or stops. They are used in the same way as work bits.
3-2-6 AR Area These bits mainly serve as flags related to CPM1/CPM1A operation. These bits retain their status even after the CPM1/CPM1A power supply has been turned off or when operation begins or stops. For details on the various bit functions, refer to relevant sections in this manual or to Appendix C Memory Areas.
3-2-7 LR Area When the CPM1/CPM1A is linked one-to-one with another CPM1/CPM1A, a CQM1, an SRM1 or a C200HS PC, these bits are used to share data. For details, refer to page 101. LR bits can be used as work bits when not used for data links.
3-2-8 Timer/Counter Area This area is used to manage timers and counters created with TIM, TIMH(15), CNT, and CNTR(12). The same numbers are used for both timers and counters and each number can be used only once in the user program. Do not use the same TC number twice even for different instructions. TC numbers are used to create timers and counters, as well as to access Completion Flags and present values (PVs). If a TC number is designated for word data, it will access the present value (PV); if it is used for bit data, it will access the Completion Flag for the timer/counter. Refer to instructions beginning on page 208 for details on timers and counters.
3-2-9 DM Area DM area data is accessed in word units only. The contents of the DM area are retained even after the CPM1/CPM1A power supply has been turned off or when operation begins or stops. DM words DM 0000 through DM 0999, DM 1022, and DM 1023 can be used freely in the program; other DM words are allocated specific functions, described below. Error Log
DM 1000 through DM 1021 contain the error log information. Refer to Section 8 Troubleshooting for details on the error log.
PC Setup
DM 6600 through DM 6655 contain the PC Setup. Refer to 1-5 PC Setup for details.
142
Page 163
Section
Using Memory Cassettes (CQM1 Only)
3-3
3-5
SRM1 Memory Area Functions
3-3-1 Memory Area Structure The following memory areas can be used with the SRM1. Data area IR area1 Input area
Output area
Work area
Words
Bits
IR 000 to IR 009 (10 words)
IR 00000 to IR 00915 (160 bits)
IR 010 to IR 019 (10 words)
IR 01000 to IR 01915 (160 bits)
IR 200 to IR 239 (40 words)
IR 20000 to IR 23915 (640 bits)
Any I/O bits not used for I/O can be used as work bits.
Work bits can be freely used within the program. IR 232 to IR 239 however, cannot be used as the the MACRO input area for the MACRO instruction. SR 24000 to SR 25507 These bits serve as storage space for flags (248 bits) and function set values/present values for SRM1 operation. Refer to SR Area.
SR area
SR 240 to SR 255 (16 words)
TR area
---
TR 0 to TR 7 (8 bits)
HR area2
HR 00 to HR 19 (20 words)
HR 0000 to HR 1915 (320 bits)
AR area2
AR 00 to AR 15 (16 words)
AR 0000 to AR 1515 (256 bits)
LR area1
LR 00 to LR 15 LR 0000 to LR 1515 (16 words) (256 bits) TC 000 to TC 127 (timer/counter numbers)3
Timer/Counter area2
Function These bits can be allocated to the external I/O terminals. The ON/OFF status of the I/O bits will be the same as the ON/OFF status of the I/O terminals
When a complicated ladder diagram cannot be recorded as a mnemonic these bits are used to temporarily store ON/OFF status at program branches. These temporary bits cannot be used within the same block but if the blocks are different several may be used. The ON/OFF status of these bits cannot be monitored using the monitoring function of a peripheral device. These bits store data and retain their ON/ OFF status when power is turned off, or operation starts or stops. They are used in the same way as work bits. These bits serve specific functions such as flags and control bits. AR 04 to 07 are used as slaves. Refer to AR Area. Used for a 1:1 data link with another SRM1, CQM1 or C200HS PC. Timers and counter use the TIM, TIMH(15), CNT and CNTR(12) instructions. The same numbers are used for both timers and counters. Timer/counter numbers should be specified as bits when dealing with timer/counter present values. The counter data will be stored even when the SRM1 power is turned off or operation is stopped or started. When timer/counter are treated as up-flags the number should be specified as relay data.
143
Page 164
Section
Using Memory Cassettes (CQM1 Only) Data area DM area Read/write2
Words DM 0000 to DM 1999 --(2,000 words)
Error log4
DM 2000 to DM 2021 --(22 words)
Read-only4
DM 6144 to DM 6599 --(456 words) DM 6600 to DM 6655 --(56 words)
PC Setup4
Note
Bits
3-5
Function DM area data can be accessed in word units only. Word values are retained when the power is turned off, or operation started or stopped. Read/write areas can be read and written freely within the program. Used to store the time of occurrence and error code of errors that occur. Refer to 5-5 Coding Right-hand Instructions. Cannot be overwritten from program. Used to store various parameters that control PC operation.
1. IR and LR bits that are not used for their allocated functions can be used as work bits. 2. The contents of the HR area, LR area, Counter area, and read/write DM area are backed up by a capacitor. At the capacitor will back up memory for 20 days. Refer to 2-1-2 Characteristics in the SRM1 Master Control Unit Operation Manual for a graph showing the backup time vs. temperature. 3. When accessing a PV, TC numbers are used as word data; when accessing Completion Flags, they are used as bit data. 4. Data in DM 6144 to DM 6655 cannot be overwritten from the program, but they can be changed from a Peripheral Device.
3-3-2 IR Area The functions of the IR area are explained below. I/O Bits
IR area bits from IR 00000 to IR 01915 are allocated to terminals on the CPU Unit and I/O Unit. They reflect the ON/OFF status of input and output signals. Input bits begin at IR 00000, and output bits begin at IR 01000. Refer to 1-4 I/O and Data Area Allocation in the SRM1 Master Control Units Operation Manual for further details.
Work Bits
The work bits can be used freely within the program. They can only be used within the program, however, and not for direct external I/O.
3-3-3 SR Area These bits mainly serve as flags related to SRM1 operation or contain present and set values for various functions. For details on the various bit functions, refer to relevant sections in this manual or to Appendix C Memory Areas. SR 240 to SR 247 and SR250, 251 can also be used as work bits, when input interrupts are not used in Counter Mode. SR232 to SR239 can also be used as work bits when the MCRO (99) instruction is not being used.
3-3-4 TR Area When a complex ladder diagram cannot be programmed in mnemonic code just as it is, these bits are used to temporarily store ON/OFF execution conditions at program branches. They are used only for mnemonic code. When programming directly with ladder diagrams using the Ladder Support Software (LSS) or the SYSMAC Support Software (SSS), TR bits are automatically processed for you. The same TR bits cannot be used more than once within the same instruction block, but can be used again in different instruction blocks. The ON/OFF status of TR bits cannot be monitored from a Peripheral Device. Examples showing the use of TR bits in programming are provided on page 169.
144
Page 165
Using Memory Cassettes (CQM1 Only)
Section
3-5
3-3-5 HR Area These bits retain their ON/OFF status even after the SRM1 power supply has been turned off or when operation begins or stops. They are used in the same way as work bits.
3-3-6 AR Area These bits mainly serve as flags related to SRM1 operation. These bits retain their status even after the SRM1 power supply has been turned off or when operation begins or stops. For details on the various bit functions, refer to relevant sections in this manual or to Appendix C Memory Areas.
3-3-7 LR Area When the SRM1 is linked one-to-one with another SRM1, a CQM1, an CPM1/CPM1A or a C200HS PC, these bits are used to share data. For details, refer to page 101. LR bits can be used as work bits when not used for data links.
3-3-8 Timer/Counter Area This area is used to manage timers and counters created with TIM, TIMH(15), CNT, and CNTR(12). The same numbers are used for both timers and counters and each number can be used only once in the user program. Do not use the same TC number twice even for different instructions. TC numbers are used to create timers and counters, as well as to access Completion Flags and present values (PVs). If a TC number is designated for word data, it will access the present value (PV); if it is used for bit data, it will access the Completion Flag for the timer/counter. Refer to instructions beginning on page 208 for details on timers and counters.
3-3-9 DM Area DM area data is accessed in word units only. The contents of the DM area are retained even after the SRM1 power supply has been turned off or when operation begins or stops. DM words DM 0000 through DM 1999, DM 2022, and DM 2047 can be used freely in the program; other DM words are allocated specific functions, described below. Error Log
DM 2000 through DM 2021 contain the error log information. Refer to Section 8 Troubleshooting for details on the error log.
PC Setup
DM 6600 through DM 6655 contain the PC Setup. Refer to 1-5 PC Setup for details.
3-4
SRM1 Flash Memory The following settings must be made to use the flash memory area for SRM1 PCs.
Writing Data
In order to write the contents of the UM area, the DM read-only area (DM 6144 to DM 6599, and the PC Setup area (DM 6600 to DM 6655) to the flash memory, either one of the following operations must be performed. • Switch the SRM1 to either the MONITOR or PROGRAM mode. • Turn the power to the SRM1 off and on again. Note If changes are made to the above memory areas, they are not written to the flash memory, and the power is switched off for 20 days or more (at 25°C), the changes (in RAM) will be lost. If this occurs, the unchanged contents will be read from the flash memory when the PC is started again.
145
Page 166
Section
Using Memory Cassettes (CQM1 Only) Changing Memory Areas
3-5
When operating the SRM1 for the first time after changes have been made to the UM area, the DM read only area (DM 6144 to DM 6599, and the PC Setup area (DM 6600 to DM 6655), beware of the effect resulting from the SRM1’s delay in the operation on other devices. The first operation for the SRM1 after the above memory areas have been changed will be a maximum of 850 ms later than the normal first operation without changes.
Cycle Times
A cycle time overflow warning will not be issued when any of the following operations are performed in either MONITOR or OPERATION modes. Be careful of the effect of using online editing on SRM1 I/O response time. • Changes to the program using online editing. • Changes to the read-only DM area (DM 6144 to DM 6599.) • Changes to the PC Setup area (DM 6600 to DM 6655.) When any of the above operations are performed, the SRM1 cycle time will be increased by a maximum of 850 ms. During this tiny interrupts will be disabled while the program or memory contents is written.
3-5
Using Memory Cassettes (CQM1 Only) When the optional Memory Cassette is used, the PC Setup, user’s program, fixed DM, and the instructions tabled can be placed in ROM. This prevents unwanted changes from being accidentally written. In addition, when changing control processes, the settings and the program can be easily changed by simply replacing the Memory Cassette. This section explains how to read, write, and compare information to and from the Memory Cassette.
3-5-1 Memory Cassettes and Contents Memory Cassettes
There are six types of Memory Cassette, as shown in the following table. Model
Remarks
CQM1-ME04K
EEPROM type (without clock) 4K words
CQM1-ME04R
EEPROM type (with clock) 4K words
CQM1-MP08K
EPROM type (without clock) 8K words
CQM1-MP08R
EPROM type (with clock) 8K words
CQM1-ME08K
EEPROM type (without clock) 8K words
CQM1-ME08R
EEPROM type (with clock) 8K words
The following EEPROM chips (sold separately) are required for EPROM-type Memory Cassettes. Model
ROM version
Capacity
Access speed
ROM-ID-B
27128 or equivalent
8K words
150 ns
ROM-JD-B
27256 or equivalent
16K words
150 ns
ROM-KD-B
27512 or equivalent
32K words
150 ns
For the CQM1 CPU Units, 8K words max. of information can be written to the Memory Cassette. Therefore, any of the EPROM chips listed above would have sufficient capacity, and the choice can be made strictly on the basis of ease of purchase. For instructions on using Memory Cassettes, refer to CQM1 Operation Manual.
146
Page 167
Section
Using Memory Cassettes (CQM1 Only) Contents
3-5
The information that can be written to a Memory Cassette is shown in the following table. Information
Contents
Fixed DM
Fixed Data Memory cannot be written from the program. The range is DM 6144 to DM 6568. These words are available for the user.
PC Setup
The PC Setup sets the operating parameters of the CQM1 and it stored in DM 6600 to DM 6655. The instructions table assigns expansion instruction to function codes to enable using them in programming. The UM area holds the user’s program.
Instructions Table User Program Memory (UM)
The above information is cannot be read, written, or compared individually, and must be treated as a single unit.
3-5-2 Memory Cassette Capacity and UM Area Size A non-fatal error will occur if an attempt is made to transfer a program that is too large. There are two cases in which this can occur. 1, 2, 3...
1. When a 4-KW EEPROM Memory Cassette is installed in a CPU Unit with a 7.2-KW UM area, programs up to 3.2 KW long can be written to the Memory Cassette. A non-fatal error will occur if an attempt is made to write a program larger than 3.2 KW to the Memory Cassette.
UM area (7.2 KW)
Memory Cassette (4 KW)
X
Program larger than 3.2 KW
2. When a 8-KW or larger Memory Cassette is installed in a CQM1-CPU11/21-E CPU Unit with a 3.2-KW UM area, programs up to 3.2 KW long can be read from the Memory Cassette. A non-fatal error will occur if an attempt is made to read a program larger than 3.2 KW from the Memory Cassette.
UM area (3.2 KW)
Memory Cassette (8 KW)
X
Program larger than 3.2 KW
Note The two transfers shown above would be completed normally if the program were 3.2 KW or smaller.
147
Page 168
Section
Using Memory Cassettes (CQM1 Only)
3-5
The approximate sizes of the programs in the UM area and Memory Cassette can be determined by the content of AR 15, as shown in the following table. Program location Memory Cassette
Bits
Content
AR 1500 00 to AR 1507 04 08
UM area
AR 1508 04 to AR 1515 08
Meaning No Memory Cassette is installed or no program is saved in the Memory Cassette. The program is less than 3.2 KW long and can be read from any CQM1 CPU Unit. The program is less than 7.2 KW long and can be read from CPU Units only. The program is less than 3.2 KW long and can be written to any Memory Cassette. The program is less than 7.2 KW long and can be written to 8-KW or larger Memory Cassettes only.
In CQM1-CPU11/21-E CPU Units, the content of AR 1508 to AR 1515 is normally 04, and the content of AR 1500 to AR 1507 is normally 04 when a 4-KW Memory Cassette is installed. The size of the program indicated in AR 15 does not include the NOP(00) instructions after END(01), but will include any instructions other than NOP(00). Be sure to clear any unneeded instructions after END(01) to get an accurate measurement of the program’s size.
3-5-3 Writing to the Memory Cassette Writing to an EPROM-type Memory Cassette is executed using either the Ladder Support Software (LSS) or SYSMAC Support Software (SSS), and a PROM Writer. For instructions on using LSS, refer to the LSS Operation Manual. For instructions on using SSS, refer to the SSS Operation Manual: C-series PCs. Follow the procedure outlined below for writing. 1, 2, 3...
1. Check to see that the write-protect switch on the Memory Cassette is OFF (i.e., writing enabled). If the switch is ON (i.e., writing not enabled), then turn the CQM1 power supply off and remove the Memory Cassette before changing the switch. 2. Check to see that the CQM1 is in PROGRAM mode. If it is in either RUN or MONITOR mode, use the LSS/SSS to change the mode. 3. Turn ON AR 1400 from the LSS/SSS. The information will be written from the CQM1 to the Memory Cassette. 4. With the LSS/SSS, clear the forced-set status to turn OFF AR 1400, which will not change even after the operation is complete. (If the Programming Console is being used, AR 1400 will automatically turn OFF.)
! Caution
Data cannot be written to the Memory Cassette if a memory error has occurred.
Note If an error occurs while data is being transmitted, a non-fatal error (FAL 9D) will be generated and the appropriate AR bit (from AR 1412 to AR 1415) will turn ON/OFF. If this occurs, refer to Section 8 Troubleshooting and make the necessary corrections.
3-5-4 Reading from the Memory Cassette There are two methods for reading data from the Memory Cassette to the CQM1: By using a Peripheral Device (e.g., LSS/SSS) or by automatic reading the contents when the CQM1 is started up. If the program on the Memory Cassette has expansion instructions with function codes different from the default settings, make sure that pin 4 of the CPU Unit’s DIP switch is ON (indicating user-allocated function codes).
148
Page 169
Using Memory Cassettes (CQM1 Only)
Section
3-5
Note When data is being read from the Memory Cassette to the CQM1, pin 1 of the DIP switch on the CQM1 must be OFF (i.e., writing to the DM must be enabled). Turn off the power to the CQM1 before turning this pin OFF. Reading from the Memory Cassette can be executed regardless of the type of Memory Cassette. If an error occurs while data is being transmitted, a non-fatal error (FAL 9D) will be generated and the appropriate AR bit (from AR 1412 to AR 1415 will turn ON/ OFF. (If this occurs, refer to the Troubleshooting section and make the necessary correction.) Peripheral Device Operation
To use a peripheral device to read from the Memory Cassette, follow the procedure outlined below.
1, 2, 3...
1. Check to see that the CQM1 is in PROGRAM mode. If it is in either RUN or MONITOR mode, use the peripheral device to change the mode. 2. Use the peripheral device to turn ON AR 1401. The information will be read from the Memory Cassette to the CQM1. 3. With the LSS/SSS, clear the forced-set status to turn OFF AR 1401, which will not change even after the operation is complete. (If the Programming Console is being used, AR 1401 will automatically turn OFF.)
Automatic Reading
If pin 2 of the DIP switch on the CQM1 is turned ON (auto-boot), then data will automatically be read from the Memory Cassette when the power supply is turned on to the CQM1. Operation will not be possible if an error occurs during transfer of data between the Memory Cassette and CQM1 memory.
! Caution
Be absolutely sure that the power is turned off before changing CQM1 DIP switch settings.
3-5-5 Comparing Memory Cassette Contents The contents of the Memory Cassette can be compared to the contents of the CQM1 memory to check to see if they are the same. This comparison can be performed for any type of Memory Cassette. Use the following procedure. 1, 2, 3...
1. Check to see that the CQM1 is in PROGRAM mode. If it is in either RUN or MONITOR mode, use the peripheral device to change to the PROGRAM mode. 2. Turn ON AR 1402 from the peripheral device. The contents of the Memory Cassette will be compared to the contents of CQM1 memory. 3. With the LSS/SSS, clear the forced-set status to turn OFF AR 1402, which will not change even after the operation is complete. (If the Programming Console is being used, AR 1402 will automatically turn OFF.) 4. Check the status of AR 1403 to see the results of the comparison. AR 1403 will be ON if the contents were not the same or if the comparison was not possible because the CQM1 was not in PROGRAM mode. If AR 1403 is OFF, the comparison was successful and the contents were the same. AR 1403 cannot be controlled from the program or from a peripheral device. It is controlled by the results of comparison only. If a comparison is attempted with the CQM1 in any mode but PROGRAM mode, a non-fatal error will occur (FAL 9D) and AR 1412 will turn ON. Although AR 1403 will also turn ON, no comparison will have been performed. AR 1403 will also turn ON if a comparison is attempted without a Memory Cassette mounted in the CQM1.
149