Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 18 of 68

Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual: SECTION 4 Writing and Inputting the Program, pages 146 to 154

Pages 146 to 154 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 146

Section 4-12

Special I/O Unit Interface Programs

4-11 Program Execution When program execution is started, the CPU Unit cycles the program from top to bottom, checking all conditions and executing all instructions accordingly as it moves down the bus bar. It is important that instructions be placed in the proper order so that, for example, the desired data is moved to a word before that word is used as the operand for an instruction. Remember that an instruction line is completed to the terminal instruction at the right before executing an instruction lines branching from the first instruction line to other terminal instructions at the right. Program execution is only one of the tasks carried out by the CPU Unit as part of the cycle time. Refer to Section 6 Program Execution Timing for details.

4-12 Special I/O Unit Interface Programs This section provides programming methods and precautions for Special I/O Unit operation.

4-12-1 Restarting Special I/O Units When a Special I/O Unit is restarted, execution of IORF(097) is disabled until Special I/O Unit initialization is completed.

SR 28100 (Unit #0 Restart Bit)

SR 27400 (Unit #0 Restart Flag)

Execution of IORF(097) for Unit #0

ON OFF

ON

Special I/O Unit Initialization

OFF

Enabled

Disabled

Enabled

While the Restart Flag (SR 27400) is ON, normal END refreshing is performed and the Special I/O Unit is initialized. This processing occurs regardless of the settings in DM 6620, DM 6621, and DM 6623 which relate to Special I/O Unit refreshing. IORF(097) instructions in the program won’t be executed for the initializing Unit until initialization is completed. Special I/O Unit data that was to be refreshed might be lost during initialization. When writing a program to restart Special I/O Units, disable programming that depends on data from the initializing Special I/O Unit, such as data used in calculations, while its Restart Flag (SR 27400 to SR 27415) is ON. Normal program operations can continue for Units that aren’t initializing. The Restart Flag won’t turn ON for Special I/O Units mounted on Slave Racks. The standard Special I/O Unit restart time is (20 × the cycle time).

133

Page 147

Section 4-12

Special I/O Unit Interface Programs

4-12-2 Special I/O Unit Error Processing Program Use a program like the one shown below to restart a Special I/O Unit in which an error has occurred. This example program restarts Unit 1.

AR 0001 (Unit #0 Error Flag) AR0001 DIFU(013) AR0101 SR 27401 (Unit #1 Restart Flag) 27401

Restart

Disables calculations during Initialization.

JMP(004) 00

Calculations using data from Special I/O Unit 1 JME(005) 00

4-12-3 Changing the Special I/O Unit Settings In the C200HX/HG/HE, ladder instructions can be used to write data into the Special I/O Unit Areas (DM 1000 to DM 2599) and change the Special I/O Unit settings. Changing the settings is useful when different settings are required for different production processes. In this example there are two production processes that require different Special I/O Unit settings. The settings for the first process are stored in DM 7000 through DM 7999 and the settings for the second process are stored in DM 8000 through DM 8999. Programming Console Operations

1, 2, 3...

Steps 1 through 5 in the following procedure aren’t necessary when XFER(070) is used to overwrite DM 1000 through DM 1999 directly from the program with the contents of fixed DM (DM 6144 through DM 6599). In this case, just restart the Unit from the program after overwriting DM 1000 through DM 1999. 1. Clear the memory (all clear).

The UM Area Allocation operation can’t be performed unless the memory has been cleared. 2. Perform the UM Area Allocation operation to allocate 2K words to the expansion DM area (DM 7000 through DM 8999). CLR

FUN

VER

PLAY SET

CHG

B

9

7

D

1

3

WRITE

3. Perform the Hexadecimal/BCD Data Modification operation to set the Special I/O Unit mode to “C200H-compatible ROM mode 1” by setting DM 6602 to #0100. This mode transfers the contents of DM 7000 through DM 7999 to DM 1000 through DM 1999 at PC startup. This new PC Setup setting won’t be effective until the PC is restarted by turning it OFF and then ON again. 4. Set pin 4 of the CPU Unit’s DIP switch to ON. This setting enables the user to assign expansion instruction function codes.

134

Page 148

Section 4-12

Special I/O Unit Interface Programs

5. XDMR(––) has a default function code of 280. If function code 280 has been assigned to another instruction, perform the Expansion Instruction Function Code Assignment operation to assign a function code to XDMR(––).

6. Input the program. The following program changes the Special I/O Unit Area settings for Unit 2, restarts the Unit, and disables calculations using data from Unit 2 while the Unit is initializing.

Example Program (Special I/O Unit 2)

End of process 1. 40000 @XDMR(280) #0100 #8200 DM1200

DIFU(013) AR0102

Unit #2 Restart Flag 27402 JMP(004) 00

Calculations using data from Special I/O Unit 2

Transfers the contents of DM 8200 through DM 8299 to DM 1200 through DM 1299. Restarts Unit 2.

Disables calculations during Initialization.

JME(005) 00

4-12-4 Special I/O Unit I/O Refreshing Interval When the interval between I/O refreshes is too short, the processing in the Special I/O Unit can be delayed causing Special I/O Unit errors or otherwise interfering with proper Unit operation. In this case, use the following methods to restore normal operation. Short Interval between END Refreshes 1, 2, 3...

There are two ways to extend the interval between I/O refreshes. Either of these methods can be used. 1. Disable cyclic Special I/O Unit refreshing in the PC Setup (DM 6621) and use IORF(097) to refresh the Special I/O Unit’s I/O only when necessary. To disable cyclic refreshing for all Special I/O Units mounted to the CPU Rack or Expansion I/O Racks, set DM 6621 to #0100. 2. Increase the PC’s cycle time by setting a minimum cycle time in the PC Setup (DM 6619) or executing SCAN(018) in the program.

Short Interval between IORF(097) and END Refresh

Change the program to use either IORF(097) refreshing or END refreshing. It is also possible to increase the PC’s cycle time by setting a minimum cycle time in the PC Setup (DM 6619) or executing SCAN(018) in the program.

Short Interval between IORF(097) Instructions

Change the program to increase the spacing between IORF(097) instructions or use just one IORF(097) instruction.

135

Page 149

Section 4-12

Special I/O Unit Interface Programs

4-12-5 Reducing the Cycle Time

Unit 3

Unit 2

Unit 1

Unit 0

When a Special I/O Unit is mounted in a C200HX/HG/HE PC, END refreshing is performed automatically each cycle without making any special settings. When several Special I/O Units are being used, the cycle time might become too long because of the time required for this automatic I/O refreshing. To reduce the time devoted to I/O refreshing, disable cyclic Special I/O Unit refreshing in the PC Setup (DM 6621) and use IORF(097) to refresh the Special I/O Units instead. I/O refreshing for all Special I/O Units mounted to the CPU Rack or Expansion I/O Racks can be disabled in the PC Setup by setting DM 6621 to #0100. The following example program reduces the Special I/O Unit refreshing time for a PC with four Special I/O Units by refreshing just one Unit each cycle. The Units are refreshed in order: Unit 0, Unit 1, Unit 2, Unit 3, Unit 0, and so on.

C200HX/HG/HE

The following program example is relevant for Special I/O Units mounted to the CPU Rack or Expansion I/O Racks only, because END refreshing is always

136

Page 150

Section 4-13

Analog Timer Unit Programming performed on Special I/O Units mounted to Slave Racks regardless of the PC Setup settings.

30000

30001

30002

30003 30000

30000

30001

30002

30003 30001

30000

30001

30002

30003 30002

30000

30001

30002

30003 30003

30001

30002

30003 30000

30000 IORF(097) 100

Refreshes Unit 0.

100 30001 IORF(097)

1 cycle

110

Refreshes Unit 1.

110 30002 IORF(097) 120

Refreshes Unit 2.

120 30003 IORF(097) 130

Refreshes Unit 3.

130

Note IR 30000 is used in an OUT instruction twice in this program. Although acceptable in the above example, this type of duplication is not usually allowed unless there is a specific reason and then only when proper operation can be ensured.

4-13 Analog Timer Unit Programming An Analog Timer Unit’s timer SV can be changed easily without a Programming Console. The Unit is equipped with an external variable resistor connector, so a variable resistor can be installed in the control panel and connected to the Analog Timer Unit to set or adjust the timer SV manually.

4-13-1 Operation When the Timer Start Input is turned ON, the Timer Set Bits allocated to the Analog Timer Unit (bits 00 to 03 of n) are turned ON, the analog timer begins to operate, and the timer set indicator (SET) on the Unit will light. When the Unit’s timer SV (set internally or externally) elapses, the Unit’s Completion Flags (bits 08 to 11 of n) and the Time-up Output will be turned ON. Also, the time-up indicator on the Unit (TIME UP) will light.

137

Page 151

Section 4-13

Analog Timer Unit Programming

Refer to the Analog Timer Unit’s Operation Manual for details on switching between internal and external timer SV settings, connecting a variable resistor, and switch settings. Timer Start Input

Timer Set Bits (Bits 00 to 03 of n)

Bits 08 to 11 of n

Time-up Output

Completion Flags

Timer Start Input Time-up Output Timer interval

4-13-2 Bit Allocation and DIP Switch Settings The following table shows the use of the word (n) allocated to the Analog Timer Unit. This word address depends upon the slot in which the Unit is mounted. Bit 00 01 02 03 04 05 06 07 08 09 10 11 12 to 15

Timer Range Setting

I/O class Output

Input

---

0.1 to 1 s 1 to 10 s 10 to 60 s 1 to 10 minutes

OFF: Enable timer operation ON: Stop timer operation

ON when timer has timed out.

---

Timer 0 Pin 8 Pin 7 OFF OFF ON OFF OFF ON ON ON

Timer 1 Pin 6 Pin 5 OFF OFF ON OFF OFF ON ON ON

Timer 2 Pin 4 Pin 3 OFF OFF ON OFF OFF ON ON ON

Timer 3 Pin 2 Pin 1 OFF OFF ON OFF OFF ON ON ON

Select internal or external setting with the lower DIP switch on the front of the Unit. Setting Internal External

138

Comments ON when timer is set.

Set the timer range with the upper DIP switch on the front of the Unit. Each timer’s range can be set independently. Range

Selecting Internal/External Timer SV Setting

Function Timer 0 Set Bit Timer 1 Set Bit Timer 2 Set Bit Timer 3 Set Bit Timer 0 Stop Bit Timer 1 Stop Bit Timer 2 Stop Bit Timer 3 Stop Bit Timer 0 Completion Flag Timer 1 Completion Flag Timer 2 Completion Flag Timer 3 Completion Flag Not used.

Timer 0 (pin 4) ON OFF

Timer 1 (pin 3) ON OFF

Timer 2 (pin 2) ON OFF

Timer 3 (pin 1) ON OFF

Page 152

Section 4-13

Analog Timer Unit Programming

4-13-3 Example Program Unit Configuration

The following table shows the word allocations for the Units in this example. Item IR word allocated to the Analog Timer Unit IR word allocated to the Input Unit IR word allocated to the Output Unit

Word IR 002 IR 000 IR 005

The Analog Timer Unit’s SV settings and external variable resistor control connections are shown below. Timer

0 1 2 3

Set value

0.6 s 3s 20 s 8 minutes

Range

Variable resistor setting

0.1 to 1 s 1 to 10 s 10 to 60 s 1 to 10 minutes

60% clockwise 30% clockwise 20% clockwise 80% clockwise

Variable resistor control Internal Internal External External

139

Page 153

Section 4-13

Analog Timer Unit Programming Unit Settings and Wiring

The following diagram shows the switch settings and wiring connections required to achieve the Unit configuration shown above.

The settings on these two variable resistor controls are valid because timers 0 and 1 are set for internal SV settings. Use the screwdriver included with the Unit to set the variable resistor. The settings on these two variable resistor controls are not valid because timers 2 and 3 are set for external SV settings.

The timer range settings are as follows: Timer 0:

Timer 1:

Timer 2:

Timer 3:

0.1 to 1 second

1 to 10 seconds 10 to 60 seconds 1 to 10 minutes

Pin 8

Pin 7

Pin 6

Pin 5

Pin 4

Pin 3

Pin 2

Pin 1

OFF

OFF

ON

OFF

OFF

ON

ON

ON

The internal/external SV settings are as follows: Timer 0

Timer 1

Timer 2

Timer 3

Pin 4

Pin 3

Pin 2

Pin 1

Internal

Internal

External

External

ON

ON

OFF

OFF

Do not connect anything to these connectors. Timers 0 and 1 are set for internal SV settings, so the variable resistor controls at the top of the Unit are used to set their SVs.

External SV Settings (0 to 20 KΩ) Connect variable resistor for timers 2 and 3 to these connectors. Refer to the Analog Timer Unit’s Operation Manual for details on these settings.

140

Page 154

Section 4-13

Analog Timer Unit Programming Ladder Program

The following diagram shows the example ladder program. 1, 2, 3...

1. Output IR 00500 will go ON about 0.6 s (T0) after input IR 00002 goes ON. 2. Output IR 00501 will go ON about 3 s (T1) after input IR 00003 goes ON. 3. Output IR 00502 will go ON about 20 s (T2) after input IR 00004 goes ON and IR 00503 will go ON about 8 minutes (T3) after input IR 00004 goes ON. 4. Timers 2 and 3 are stopped by input IR 00005. Timer Stop Bit

00005 Timer 0 Completion Flag 00206

T2 Timers 2 and 3 stop operating when the emergency stop input goes ON.

00207

T3

Timer 0 Set Bit 00002 00200

T0

00208 00500 Timer 0 Completion Flag

Timer 1 Set Bit

Timer 0 (00200) starts operating and the Unit’s SET indicator lights when IR 00002 goes ON. When the time set on the internal volume control elapses, the Completion Flag (00208) goes ON and the Unit’s TIME UP indicator lights. Output IR 00500 goes ON at the same time.

00003 00201

T1

00209 00501 Timer 1 Completion Flag

Timer 2 Set Bit

Timer 1 (00201) starts operating and the Unit’s SET indicator lights when IR 00003 goes ON. When the time set on the internal variable resistor control elapses, the Completion Flag (00209) goes ON and the Unit’s TIME UP indicator lights. Output IR 00501 goes ON at the same time.

00004 00202

T2 Timer 2 (00202) and timer 3 (00203) start operating and the Unit’s SET indicator lights when IR 00004 goes ON.

00203

00210 00502 Timer 2 Completion Flag

00211 00503 Timer 3 Completion Flag

T3 When the time set on the external variable resistor control elapses, the Completion Flag (00210) goes ON and the Unit’s TIME UP indicator lights. Output IR 00502 goes ON at the same time. When the time set on the external variable resistor control elapses, the Completion Flag (00211) goes ON and the Unit’s TIME UP indicator lights. Output IR 00503 goes ON at the same time.

141