The text of a manual · part 38 of 68
Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual: SECTION 5 Instruction Set, pages 344 to 353
Pages 344 to 353 of 613, from Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual
The original document is the PDF (3.8 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.
Filed in the catalog under the Omron C200H-SP001 and Omron C200HW-PA204
Page 344
Section 5-25
Step Instructions
The following diagram demonstrates the flow of processing and the switches that are used for execution control. SW1 Process A
Loading SW2
Process B
Part Installation SW3
Process C
Inspection/discharge SW4
332
Page 345
Section 5-25
Step Instructions
The program for this process, shown below, utilizes the most basic type of step programming: each step is completed by a unique SNXT(009) that starts the next step. Each step starts when the switch that indicates the previous step has been completed turns ON.
00001 (SW1) SNXT(009) 12800
Process A started.
STEP(008) 12800
Process A
00002 (SW2) SNXT(009) 12801
Process A reset. Process B started.
STEP(008) 12801
Process B
00003 (SW3) SNXT(009) 12802
Process B reset. Process C started.
STEP(008) 12802
Process C
00004 (SW4) SNXT(009) 12803
Process C reset.
STEP(008)
Address
Instruction
00000 00001 00002
LD SNXT(009) STEP(008)
Operands 00001 12800 12800
Process A 00100 00101 00102
LD SNXT(009) STEP(008)
00002 12801 12801
Address
Instruction
Operands
Process B 00100 00101 00102
LD SNXT(009) STEP(008)
00003 12802 12802
Process C 00200 00201 00202
LD SNXT(009) STEP(008)
00004 12803 ---
333
Page 346
Section 5-25
Step Instructions Example 2: Branching Execution
The following process requires that a product is processed in one of two ways, depending on its weight, before it is printed. The printing process is the same regardless of which of the first processes is used. Various sensors are positioned to signal when processes are to start and end. Printer
SW A2
SW A1
SW D
Process A Process B
SW B1
SW B2
Weight scale
Process C
The following diagram demonstrates the flow of processing and the switches that are used for execution control. Here, either process A or process B is used depending on the status of SW A1 and SW B1.
SW B1
SW A1 Process A SW A2 Process C SW D End
334
Process B SW B2
Page 347
Section 5-25
Step Instructions
The program for this process, shown below, starts with two SNXT(009) instructions that start processes A and B. Because of the way 00001 (SW A1) and 00002 (SB B1) are programmed, only one of these will be executed to start either process A or process B. Both of the steps for these processes end with a SNXT(009) that starts the step for process C.
00001 (SW A1) 00002 (SW B1) SNXT(009) HR 0000 00001 (SW A1) 00002 (SW B1) SNXT(009) HR 0001
STEP(008) HR 0000 Process A started.
Process A
00003 (SW A2) SNXT(009) HR 0002
Process A reset. Process C started.
STEP(008) HR 0001
Process B
00004 (SW B2) SNXT(009) HR 0002
Process B reset. Process C started.
STEP(008) HR 0002
Process C
00005 (SW D) SNXT(009) HR 0003
Process C reset.
STEP(008)
Address
Instruction
00000 00001 00002 00003 00004 00005 00006
LD AND NOT SNXT(009) LD NOT AND SNXT(009) STEP(008)
Operands 00001 00002 HR 0000 00001 00002 HR 0001 HR 0000
Address
Instruction
Operands
Process B 00100 00101 00102
LD SNXT(009) STEP(008)
00004 HR 0002 HR 0002
Process C Process A 00100 00101 00102
LD SNXT(009) STEP(008)
00003 HR 0002 HR 0001
00200 00201 00202
LD SNXT(009) STEP(008)
00005 HR 0003 ---
335
Page 348
Step Instructions
Section 5-25
Example 3: Parallel Execution
The following process requires that two parts of a product pass simultaneously through two processes each before they are joined together in a fifth process. Various sensors are positioned to signal when processes are to start and end. SW1
Process A
SW3
SW5
SW7
Process B Process E Process D
Process C SW2
SW4
SW6
The following diagram demonstrates the flow of processing and the switches that are used for execution control. Here, process A and process C are started together. When process A finishes, process B starts; when process C finishes, process D starts. When both processes B and D have finished, process E starts.
SW 1 and SW2 both ON
Process A
Process C
SW4
SW3 Process B
Process D
SW5 and SW6 both ON Process E SW7
End
The program for this operation, shown below, starts with two SNXT(009) instructions that start processes A and C. These instructions branch from the same instruction line and are always executed together, starting steps for both A and C. When the steps for both A and C have finished, the steps for process B and D begin immediately. When both process B and process D have finished (i.e., when the status for both of them is “ON,” but SW5 and SW6 have turned ON), processes B and D are reset together by the SNXT(009) at the end of the programming for process B. Although there is no SNXT(009) at the end of process D, the control bit for it is turned OFF by executing SNXT(009) LR 0004. This is because the OUT for LR 0003 is in the step reset by SNXT(009) LR 0004, i.e., LR 0003 is turned OFF when SNXT(009) LR 0004 is executed Process B is thus reset directly and process D is reset indirectly before executing the step for process E.
336
Page 349
Section 5-25
Step Instructions
00001 (SW1 and SW2)) SNXT(009) LR 0000 Process A started.
Process C started. SNXT(009) LR 0002
STEP(008) LR 0000
Process A
00002 (SW3) SNXT(009) LR 0001
Process A reset. Process B started.
STEP(008) LR 0001
Process B
LR 0003 LR 0003
Used to turn OFF process D.
00004 (SW5 and SW6) SNXT(009) LR 0004
Process E started.
STEP(008) LR 0002
Process C
00003 (SW4) SNXT(009) LR 0003
Process C reset. Process D started.
STEP(008) LR 0003
Process D
STEP(008) LR 0004
Process E
00005 (SW7) SNXT(009) LR 0005
Process E reset.
STEP(008)
337
Page 350
Section 5-26
Special Instructions Address
Instruction
00000 00001 00002 00003
LD SNXT(009) SNXT(009) STEP(008)
Operands 00001 LR 0000 LR 0002 LR 0000
Instruction
00204
STEP(008)
LD SNXT(009) STEP(008)
Operands LR 0002
Process C 00300 00301 00302
Process A 00100 00101 00102
Address
00002 LR 0001 LR 0001
LD SNXT(009) STEP(008)
00003 LR 0003 LR 0003
Process D 00400
STEP(008)
LR 0004
Process B Process E 00200 00201 00202 00203
LD OUT AND SNXT(009)
LR 0003 LR 0003 00004 LR 0004
00500 00501 00502
LD SNXT(009) STEP(008)
00005 LR 0005 ---
5-26 Special Instructions The instructions in this section are used for various operations, including programming user error codes and messages, counting ON bits, setting the watchdog timer, and refreshing I/O during program execution.
5-26-1 FAILURE ALARM – FAL(006) and SEVERE FAILURE ALARM – FALS(007) Ladder Symbols FAL(006) N
Definer Data Areas
@FAL(006) N
N: FAL number # (00 to 99)
N: FAL number
FALS(007) N
# (01 to 99)
Limitations
FAL(006) and FALS(007) share the same FAL numbers. Be sure to use a number in either FAL(006) or FALS(007), not both.
Description
FAL(006) and FALS(007) are provided so that the programmer can output error numbers for use in operation, maintenance, and debugging. When executed with an ON execution condition, either of these instructions will output a FAL number to bits 00 to 07 of SR 253. The FAL number that is output can be between 01 and 99 and is input as the definer for FAL(006) or FALS(007). FAL(006) with a definer of 00 is used to reset this area (see below). FAL Area 25307
25300
X101
338
X100
Page 351
Section 5-26
Special Instructions
FAL(006) produces a non-fatal error and FAL(007) produces a fatal error. When FAL(006) is executed with an ON execution condition, the ALARM/ERROR indicator on the front of the CPU Unit will flash, but PC operation will continue. When FALS(007) is executed with an ON execution condition, the ALARM/ERROR indicator will light and PC operation will stop. The system also generates error codes to the FAL area. Resetting Errors
All FAL error codes will be retained in memory, although only one of these is available in the FAL area. To access the other FAL codes, reset the FAL area by executing FAL(006) 00. Each time FAL(006) 00 is executed, another FAL error will be moved to the FAL area, clearing the one that is already there. FAL error codes are recorded and will be recalled in the following order: First code generated, lowest FAL number greater than the first code, lowest FAL number lower than the first code.
Clearing Messages
FAL(006) 00 is also used to clear message programmed with the instruction, MSG(046). If the FAL area cannot be cleared, as is generally the case when FALS(007) is executed, first remove the cause of the error and then clear the FAL area through the Programming Console (see 4-6-5 Clearing Error Messages).
5-26-2 CYCLE TIME – SCAN(018) Operand Data Areas Mi: Multiplier (BCD)
Ladder Symbols
IR, SR, AR, DM, EM, HR, TC, LR, # SCAN(018)
@SCAN(018)
Mi
Mi
000
000
000
000
000: Not used.
Limitations
000: Not used.
Mi must be BCD. Only the rightmost three digits of Mi are used. SCAN(018) is an expansion instruction. A Programming Device can be used to reassign function code 018 to another expansion instruction.
Description
SCAN(018) is used to set a minimum cycle time. Mi is the minimum cycle time that will be set in tenths of milliseconds, e.g., if Mi is 1200, the minimum cycle time will be 120.0 ms. The possible setting range is from 000.0 to 999.0 ms. If the actual cycle time is less than the cycle time set with SCAN(018) the CPU Unit will wait until the designated time has elapsed before starting the next cycle. If the actual cycle time is greater than the set time, the set time will be ignored and the program will be executed to completion.
Flags
ER:
The content of a word containing an indirect DM/EM address is not BCD or the DM/EM area boundary has been exceeded. Mi is not BCD.
339
Page 352
Section 5-26
Special Instructions
5-26-3 TRACE MEMORY SAMPLING – TRSM(045) Data tracing can be used to facilitate debugging programs. To set up and use data tracing it is necessary to have a host computer running CX-Programmer; no data tracing is possible from a Programming Console. Data tracing is described in detail in the CX-Programmer Operation Manual. This section shows the ladder symbol for TRSM(045) and gives an example program. Ladder Symbol TRSM(045) Description
TRSM(045) is used in the program to mark locations where specified data is to be stored in Trace Memory. Up to 12 bits and up to 3 words may be designated for tracing (refer to the SYSMAC-CPT Support Software Operation Manual for details). TRSM(045) is not controlled by an execution condition, but rather by two bits in the AR area: AR 2515 and AR 2514. AR 2515 is the Sampling Start bit. This bit is turned ON to start the sampling processes for tracing. The Sampling Start bit must not be turned ON from the program, i.e., it must be turned ON only from the Programming Device. AR 2514 is the Trace Start bit. When it is set, the specified data is recorded in Trace Memory. The Trace Start bit can be set either from the program or from the Programming Device. A positive or negative delay can also be set to alter the actual point from which tracing will begin. Data can be recorded in any of three ways. TRSM(045) can be placed at one or more locations in the program to indicate where the specified data is to be traced. If TRSM(045) is not used, the specified data will be traced when END(001) is executed. The third method involves setting a timer interval from the Programming Device so that the specified data will be tracing at a regular interval independent of the cycle time (refer to the SYSMAC-CPT Support Software Operation Manual). TRSM(045) can be incorporated anywhere in a program, any number of times. The data in the trace memory can then be monitored via a Programming Console, host computer, etc.
AR Control Bits and Flags
The following control bits and flags are used during data tracing. The Tracing Flag will be ON during tracing operations. The Trace Completed Flag will turn ON when enough data has been traced to fill Trace Memory. Flag
Function
AR 2515
Sampling Start Bit
AR 2514
Trace Start Bit
AR 2513
Tracing Flag
AR 2512
Trace Completed Flag
Precautions
If TRSM(045) occurs TRSM(045) will not be executed within a JMP(008) – JME(009) block when the jump condition is OFF.
Example
The following example shows the basic program and operation for data tracing. Force set the Sampling Start Bit (AR 2515) to begin sampling. The Sampling Start Bit must not be turned ON from the program. The data is read and stored into trace memory. When IR 00000 is ON, the Trace Start Bit (AR 2514) is also turned ON, and the CPU Unit looks at the delay and marks the trace memory accordingly. This can mean that some of the samples already made will be recorded as the trace
340
Page 353
Section 5-26
Special Instructions memory (negative delay), or that more samples will be made before they are recorded (positive delay). The sampled data is written to trace memory, jumping to the beginning of the memory area once the end has been reached and continuing up to the start marker. This might mean that previously recorded data (i.e., data from this sample that falls before the start marker) is overwritten (this is especially true if the delay is positive). The negative delay cannot be such that the required data was executed before sampling was started. 00000
AR 2514
TRSM(045)
AR 2513 ON when tracing
Instruction
00000 00001 00002 00003
LD OUT TRSM(045) LD
Operands
Address
0000 AR 2514
Designates point for tracing.
00200
Indicates that tracing is in progress.
00201
Indicates that tracing has been completed.
AR 2512 ON when trace is complete
Address
Starts data tracing.
Instruction
00004 00005 00006
Operands
OUT LD OUT
00200 AR 2512 00201
AR 2513
5-26-4 MESSAGE DISPLAY – MSG(046) Ladder Symbols
Operand Data Areas
MSG(046)
@MSG(046)
FM
FM
FM: First message word IR, SR, AR, DM, EM, HR, LR, TC
Limitations
FM and FM+7 must be in the same data area.
Description
When executed with an ON execution condition, MSG(046) reads eight words of extended ASCII code from FM to FM+7 and displays the message on the Programming Console. The displayed message can be up to 16 characters long, i.e., each ASCII character code requires eight bits (two digits). Refer to Appendix I for the extended ASCII codes. Japanese katakana characters are included in this code. If not all eight words are required for the message, it can be stopped at any point by inputting “0D.” When 0D is encountered in a message, no more words will be read and the words that normally would be used for the message can be used for other purposes.
Message Buffering and Priority
Up to three messages can be buffered in memory. Once stored in the buffer, they are displayed on a first in, first out basis. Since it is possible that more than three MSG(046)s may be executed within a single cycle, there is a priority scheme, based on the area where the messages are stored, for the selection of those messages to be buffered. The priority of the data areas is as follows for message display:
341