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

The text of a manual · part 6 of 60

SYSMAC CQM1/CPM1/CPM1A/SRM1 Programmable Controllers Programming Manual: SECTION 1 PC Setup and Other Features, pages 41 to 50

Pages 41 to 50 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 41

Section

Basic PC Operation and I/O Processes

1-2

1-2-9 DSW(87) Input Digits & Output Refresh Method (CQM1 Only) Make the settings shown below to set the number of input digits the DSW(87) instruction, and to set the output refresh method. Bit 15 DM 6639

0

Number of input digits for the DSW(87) 00: 4 digits 01: 8 digits Output refresh method 00: Cyclic 01: Direct Default: The number of input digits for the DSW(87) instruction is set to “4” and the output refresh method is cyclic.

Refer to Section 2 New Features for details on the DSW(87) instruction and to Section 7 PC Operations and Processing Time for details on I/O refresh methods.

1-2-10 Error Log Settings Make the settings shown below for detecting errors and storing the error log. Cycle Monitor Time (DM 6618) Bit 15 DM6618

0

Cycle Monitor Time Enable and Unit 00: Setting disabled (time fixed at 120 ms) 01: Setting in 00 to 07 enabled; unit:10 ms 02: Setting in 00 to 07 enabled; unit:100 ms 03: Setting in 00 to 07 enabled; unit:1 s Cycle monitor time setting (When bits 08 to 15 are not 00) 00 to 99 (2 digits BCD; unit set in bits 08 to 15.) Default: 120 ms.

The cycle monitor time is used for checking for extremely long cycle times, as can happen when the program goes into an infinite loop. If the cycle time exceeds the cycle monitor setting, a fatal error (FALS 9F) will be generated. Note

1. The unit used for the maximum and current cycle times recorded in the AR area (AR 26 and AR 27 in the CQM1, AR 14 and AR 15 in the CPM1/CPM1A/SRM1) depend on the unit set for the cycle monitor time in DM 6618, as shown below. Bits 08 to 15 set to 01: 0.1 ms Bits 08 to 15 set to 02: 1 ms Bits 08 to 15 set to 03: 10 ms 2. If the cycle time is 1 s or longer, the cycle time read from Programming Devices will be 999.9 ms. The correct maximum and current cycle times will be recorded in the AR area. Example If 0230 is set in DM 6618, an FALS 9F error will not occur until the cycle time exceeds 3 s. If the actual cycle time is 2.59 s, the current cycle time stored in the AR area will be 2590 (ms), but the cycle time read from a Programming Device will be 999.9 ms. A “cycle time over” error (non-fatal) will be generated when the cycle time exceeds 100 ms unless detection of long cycle times is disable using the setting in DM 6655.

21

Page 42

Section

Pulse Output Function (CQM1 Only)

1-3

Error Detection and Error Log Operation (DM 6655) Make the settings shown below to determine whether or not a non-fatal error is to be generated when the cycle time exceeds 100 ms or when the voltage of the built-in battery drops (CQM1 only), and to set the method for storing records in the error log when errors occur. Bit 15 DM6655

Low battery voltage detection 0: Detect 1: Don’t detect

0

0 Always 0

Cycle time over detection 0: Detect 1: Don’t detect Error log storage method 0: Error records for 10 (CQM1) or 7 (SRM1/CPM1/CPM1A) most recent errors always stored (older errors deleted). 1: Only first 10 (CQM1) or 7 (SRM1/CPM1/CPM1A) error records stored (no errors stored beyond that point). 2 to F: Error records not stored. Default: Low battery voltage and cycle time over errors detected, and error records stored for the 10 most recent errors.

Battery errors and cycle time overrun errors are non-fatal errors. For details on the error log, refer to Section 8 Troubleshooting. Note The low battery error is applicable to CQM1 only. This digit isn’t used in CPM1/CPM1A/SRM1 PCs.

1-3

Pulse Output Function (CQM1 Only) This section explains the settings and methods for using the CQM1 pulse output function. Refer to the CQM1 Operation Manual for details on hardware connections to output points and ports.

1-3-1 Types of Pulse Outputs All of the CQM1 PCs can output standard pulses from an output bit and the CQM1-CPU43-EV1 can also output standard or variable-duty-ratio pulses from ports 1 and 2. Standard pulse outputs have a duty ratio (ton/T) of 50%. The duty ratio for variable-duty-ratio pulse outputs can be set from 1% to 99% in 1% increments. Note With the CQM1-CPU43-EV1, the pulse outputs described below can be output from three ports simultaneously. Furthermore, two ports can be used for counter inputs independent of the pulse output. Standard Pulse Output from an Output Point

Standard pulses (duty ratio = 50%) can be output from an output point with a frequency from 20 Hz to 1 kHz. The I/O word is specified in the PC Setup and the bit is specified in the pulse output instruction itself. Refer to page 23 for more details.

Standard Pulse Output from Ports 1 and 2

With the CQM1-CPU43-EV1, standard pulses (duty ratio = 50%) can be output from port 1 and/or 2 with a frequency from 10 Hz to 50 kHz (20 kHz max. to a stepping motor). The pulse output can be either clockwise (CW) or counterclockwise (CCW) and frequency changes can be made smoothly. PLS2(––) and mode 0 of ACC(––) cannot be used when the PC Setup (DM 6611) is set to high-speed counter mode. CTBL(63) cannot be used with ports 1 and 2 when the PC Setup (DM 6611) is set to pulse output mode. Refer to page 25 for more details.

22

Page 43

Section

Pulse Output Function (CQM1 Only) Variable-duty-ratio Pulse Output from Ports 1 and 2

1-3

With the CQM1-CPU43-EV1, variable-duty-ratio pulses (duty ratio = 0% to 99%) can be output from port 1 and/or 2 with frequencies of 91.6 Hz, 1.5 kHz, or 5.9 kHz. Only one direction can be output and the pulse output will continue until stopped with INI(61). Refer to page 32 for more details.

1-3-2 Standard Pulse Output from an Output Point Standard pulses can be output from a specified output bit using SPED(64). Pulses can be output from just one bit at a time. The following diagram shows the pulses being output from the output point of the Transistor Output Unit mounted on a CQM1 PC. The duty ratio of the pulse output is 50% and the frequency can be set from 20 Hz to 1 kHz. Transistor Output Unit t on + 50% (0.5) T ton

T

Note

1. A Transistor Output Unit must be used for this application. 2. Pulses cannot be output when interval timer 0 is operating. 3. When a pulse output higher than 500 Hz is being output, set the number of high-speed timers with interrupt processing to 4 by setting DM 6629 to 0104.

Frequency

When outputting pulses from an output point, the frequency can be changed in steps by executing SPED(64) again with different frequencies, as shown in the following diagram.

Time

There are two ways to stop the pulse output: 1, 2, 3...

1. After executing SPED(64), the pulse output will stop if INI(61) is executed with C=003 or SPED(64) is executed again with the frequency set to 0. 2. The total number of pulses that will be output can be set with PULS(65) before execution of SPED(64). In this case, SPED(64) must be executed in independent mode. The pulse output stops automatically when the number of pulses set by PULS(65) have been output.

Note Refer to the sections on SPED(64) and PULS(65) for more details on these instructions. PC Setup Settings

Before executing SPED(64) to output pulses from an Output Unit, set the PC to PROGRAM mode and make the following settings in the PC Setup. In DM 6615, specify the output word that will be used for SPED(64) pulse output to Output Units. (The bit is specified in the first operand in SPED(64).)

23

Page 44

Section

Pulse Output Function (CQM1 Only)

1-3

The content of DM 6615 (0000 to 0011) specifies output words IR 100 to IR 111. For example, if DM 6615 is set to 0002, pulses will be output to IR 102. Bit 15 DM6615

0

0

0

Always 00 Output word (rightmost 2 digits, BCD): 00 to 11 Default: Pulse output to IR 100.

In the CQM1-CPU11/21-E CPUs, set direct output refreshing in DM 6639, as shown below. (In CPU Units the output refresh method can be set to either direct or cyclic.) Bit 15 DM 6639

0

0

1

Output refresh method 01: Direct Default: The default output refresh method is cyclic.

Continuous Pulse Output

Pulses will begin to be output at the specified output bit when SPED(64) is executed. Set the output bit from 00 to 15 (D=000 to 150) and the frequency from 20 Hz to 1000 Hz (F=0002 to 0100). Set the mode to continuous mode (M=001). Execution condition @SPED(64) D M F

The pulse output can be stopped by executing INI(61) with C=003 or executing SPED(64) again with the frequency set to 0. The frequency can be changed by executing SPED(64) again with a different frequency setting. Setting the Number of Pulses The total number of pulses that will be output can be set with PULS(65) before executing SPED(64) in independent mode. The pulse output will stop automatically when the number of pulses set by PULS(65) have been output. Execution condition @PULS(65) 000 000 P1

PULS(65) sets the 8-digit number of pulses P1+1, P1. These pulses can be set from 00000001 to 16777215. The number of pulses set with PULS(65) is accessed when SPED(64) is executed in independent mode. (The number of pulses cannot be changed for pulses that are being output.) Execution condition @SPED(64) D M F

When SPED(64) is executed, pulses will begin to be output at the specified output bit (D=000 to 150: bit 00 to 15) at the specified frequency (F=0002 to 0100: 20 Hz to 1000 Hz). Set the mode to independent mode (M=001) to output the number of pulses set with PULS(65). The frequency can be changed by executing SPED(64) again with a different frequency setting.

24

Page 45

Section

Pulse Output Function (CQM1 Only) Changing the Frequency

1-3

The frequency of the pulse output can be changed by executing SPED(64) again with a different frequency setting. Use the same output bit (P) and mode (M) settings that were used to start the pulse output. The new frequency can be frequency 20 Hz to 1000 Hz (F=0002 to 0100).

1-3-3 Standard Pulse Output from Ports 1 and 2 With the CQM1-CPU43-EV1, standard pulses can be output from ports 1 and 2 using SPED(64), PLS2(––), or ACC(––). The pulse frequency can be set from 10 Hz to 50 kHz (20 kHz max. to a stepping motor). The pulse output can be either clockwise (CW) or counter-clockwise (CCW) and frequency changes can be made smoothly. CPU Unit t on + 50% (0.5) T Port 1

CW CCW CW CCW

Port 2 ton

T

Note Only the CQM1-CPU43-EV1 CPU Unit can output pulses from ports 1 and 2.

Frequency

When outputting pulses from a port, the frequency can be changed smoothly or in steps with SPED(64), PLS2(––), and ACC(––), as shown in the following diagram.

Time

There are two ways to stop the pulse output: 1, 2, 3...

1. After executing SPED(64), the pulse output will stop if INI(61) is executed with C=003 or SPED(64) is executed again with the frequency set to 0. 2. The total number of pulses that will be output can be set with PULS(65) before execution of SPED(64). In this case, SPED(64) must be executed in independent mode. The pulse output stops automatically when the number of pulses set by PULS(65) have been output.

25

Page 46

Section

Pulse Output Function (CQM1 Only)

1-3

The following table shows the types of frequency changes that can be made with combinations of PULS(65), SPED(64), INI(61), PLS2(––), and ACC(––). Frequency change Start pulse output at the specified frequency.

Instruction

Operand settings

PULS(65)

CW/CCW (Number of pulses)

Outputs continuously or until the specified number of pulses have been output.

SPED(64)

Port Mode Frequency

SPED(64)

Port Frequency= 0 Control word=0 Port CW/CCW Acceleration rate Target frequency Number of pulses

28

PULS(65)

CW/CCW Number of pulses Deceleration point

30

ACC(––) (Mode 0)

Port Acceleration rate Target frequency 1 Deceleration rate Target frequency 2

PULS(65)

CW/CCW

ACC(––) (Mode 1)

Port Acceleration rate Target frequency

Decelerates pulse output from the current frequency to the target frequency at the specified rate.

PULS(65)

CW/CCW Number of pulses

Pulse output will stop when the specified number of pulses have been output.

ACC(––) (Mode 2)

Port Deceleration rate Target frequency

PULS(65)

CW/CCW

ACC(––) (Mode 3)

Port Deceleration rate Target frequency

(Execute PULS(65) and then SPED(64).) Stop pulse output with an instruction. (Execute SPED(64) or INI(61).) Outputs a specified number of pulses.

INI(61) PLS2(––)

Accelerates pulse output to the target frequency at the specified rate. Decelerates at the same rate. Outputs a specified number of pulses. Accelerates pulse output to target frequency 1 at the specified rate. Decelerates to target frequency 2 at another rate. (Execute PULS(65) and then ACC(––).)

Accelerates pulse output from the current frequency to the target frequency at the specified rate. Pulse output will continue. (Execute PULS(65) and then ACC(––).)

(Execute PULS(65) and then ACC(––).) Decelerates pulse output from the current frequency to the target frequency at the specified rate. Pulse output will continue. (Execute PULS(65) and then ACC(––).)

PC Setup Settings

29

30

31

31

Before outputting pulses from port 1 or 2, switch the PC to PROGRAM mode and make the following settings in the PC Setup. In DM 6611, specify the mode setting for ports 1 and 2.

Bit 15 DM 6611

0

0

1

Port 1 and 2 Mode Setting 0000: High-speed counter mode 0001: Pulse output mode Default: The default mode setting is high-speed counter mode.

26

Page 27

Page 47

Section

Pulse Output Function (CQM1 Only)

1-3

Some instructions cannot be used depending on the mode setting in DM 6611. DM 6611 setting

Affected instructions

High-speed counter mode (0000)

PLS2(––) and mode 0 of ACC(––) cannot be used. CTBL(63) cannot be used with ports 1 and 2.

Pulse output mode (0001)

The setting in DM 6611 is read only when the CQM1 is started. If this setting is changed, be sure to turn the PC off and then on again to make the new setting effective. Specify standard pulse outputs in DM 6643 (port 1) and/or DM 6644 (port 2). Bit 15 DM 6643 0

Bit 15 DM 6644 0

0

Port 1 pulse type setting 0: Standard pulse output Default: Standard pulse output

0

Port 2 pulse type setting 0: Standard pulse output Default: Standard pulse output

Variable-duty-ratio pulses cannot be output from a port if it has been set for standard pulse output in DM 6643 or DM 6644. Example 1: Starting Pulse Output with PULS(65) and SPED(64)

The following example shows PULS(65) and SPED(64) used to control a pulse output from port 1. The number of pulses specified in PULS(65) (10,000) are output as the frequency is changed by executions of SPED(64) with different frequency settings. Before executing the program make sure that DM 6611 is set to 0001 (pulse output mode) and DM 6643 is set to 0000 (standard pulse setting for port 1).

05000 @PULS(65)

When 05000 goes ON, PULS(65) sets port 1 for 10,000 CW pulses.

001 000 DM 0000 @SPED(64)

Starts pulse output from port 1 at 1 kHz in independent mode.

001 000 #0100 00000 @SPED(64)

When 00000 goes ON, the frequency from port 1 is changed to 1.5 kHz.

001 000 #0150 00001 @SPED(64)

When 00001 goes ON, the frequency from port 1 is changed to 1 kHz.

001 000 #0100 00002 @SPED(64)

When 00002 goes ON, the frequency from port 1 is changed to 500 Hz.

001 000 #0050

27

Page 48

Section

Pulse Output Function (CQM1 Only)

1-3

The following diagram shows the frequency of pulse outputs from port 1 as the program is executed.

Frequency 1.5 kHz 1.0 kHz 0.5 kHz Time 05000 goes ON

! Caution

00000 goes ON

00001 goes ON

00002 goes ON

10,000 pulses

Be sure that the pulse frequency is within the motor’s self-starting frequency range when starting and stopping the motor.

Note Speed control timing will be very accurate when frequency changes are performed as input interrupt processes. Example 2: Stopping Pulse Output with SPED(64)

The following example shows PULS(65) and SPED(64) used to control a pulse output from port 1. The frequency is changed by executions of SPED(64) with different frequency settings and finally stopped with a frequency setting of 0.

05000 @PULS(65)

When 05000 goes ON, PULS(65) sets port 1 for CW pulse output. There is no number of pulses setting.

001 004 000 @SPED(64)

Starts pulse output from port 1 at 1 kHz in continuous mode.

001 001 #0100 00005 @SPED(64)

When 00005 goes ON, the frequency from port 1 is changed to 1.5 kHz.

001 001 #0150 00006 @SPED(64)

When 00006 goes ON, the frequency from port 1 is changed to 1 kHz.

001 001 #0100 00007 @SPED(64) 001 001 #0000

28

When 00007 goes ON, the pulse output from port 1 is stopped with a frequency setting of 0 Hz.

Page 49

Section

Pulse Output Function (CQM1 Only)

1-3

The following diagram shows the frequency of pulse outputs from port 1 as the program is executed. Frequency 1.5 kHz 1.0 kHz

Time 05000 goes ON

! Caution

Example 3: PLS2(––)

00005 goes ON

00006 goes ON

00007 goes ON

Be sure that the pulse frequency is within the motor’s self-starting frequency range when starting and stopping the motor. The following example shows PLS2(––) used to output 100,000 CW pulses from port 1. The frequency is accelerated to 10 kHz at approximately 500 Hz/4 ms and decelerated at the same rate. Five seconds after the CW pulses have been output, another PLS2(––) instruction outputs 100,000 CCW pulses with the same settings. DM 0000 DM 0001 DM 0002 DM 0003

0050 1000 0000 0010

00000 SET 05000

05000 is turned ON when 00000 is ON.

@PLS2(––)

When 05000 goes ON, PLS2(––) starts CW pulse output from port 1.

05000 001 000

Acceleration rate: Approx. 500 Hz/4 ms Target frequency: 10 kHz Number of pulses: 100,000

DM 0000 AR 0514 TIM 000

A 5 s timer is started when AR 0514 (the Pulse Output Completed flag) is ON.

#0050 TIM 000 @PLS2(––) 001 001

When TIM 000 times out, PLS2(––) starts CCW pulse output from port 1. Acceleration rate: Approx. 500 Hz/4 ms Target frequency: 10 kHz Number of pulses: 100,000

DM 0000 RSET 05000

05000 is turned OFF when TIM 000 times out.

The following diagram shows the frequency of pulse outputs from port 1 as the program is executed. Frequency CW pulse output

CCW pulse output

10 kHz About 500 Hz/4 ms Time 05000 goes ON

AR 0514 goes ON

After 5 s

29

Page 50

Section

Pulse Output Function (CQM1 Only) Example 4: ACC(––) Mode 0

1-3

The following example shows mode 0 of ACC(––) used to output 10,000 CW pulses from port 1. The frequency is accelerated to 10 kHz at approximately 1 kHz/4 ms and decelerated to 1 kHz at approximately 250 Hz/4 ms. Deceleration begins after 9,100 pulses have been output. DM 0000 DM 0001 DM 0002 DM 0003

0000 0001 9100 0000

DM 0004 DM 0005 DM 0006 DM 0007

0100 1000 0025 0050

00000 @PULS(65) 001

When 00000 goes ON, PULS(65) sets port 1 for CW pulse output. The total number of pulses is set to 10,000 and the deceleration point is set to 9,100 pulses.

002 DM 0000 @ACC(––)

Starts CW pulse output from port 1. Acceleration rate: Approx. 1000 Hz/4 ms Frequency after acceleration: 10 kHz Deceleration rate: Approx. 250 Hz/4 ms Frequency after deceleration: 1 kHz

001 000 DM 0004

The following diagram shows the frequency of pulse outputs from port 1 as the program is executed. Frequency 10 kHz About 250 Hz/4 ms About 1 kHz/4 ms 1 kHz

Time 00000 goes ON

Example 5: ACC(––) Mode 1

9,100 pulses

10,000 pulses

The following example shows mode 1 of ACC(––) used increase the frequency of a pulse output from port 1. The frequency is accelerated from 1 kHz to 20 kHz at approximately 500 Hz/4 ms. DM 0000 DM 0001

0050 2000

00000 @PULS(65)

When 00000 goes ON, PULS(65) sets port 2 for CCW pulse output. The number of pulses is not set.

002 005 000 @SPED(64)

Starts 1 kHz pulse output from port 2 in continuous mode.

002 001 #0100 @ACC(––) 002 001 DM 0000

30

When 00001 goes ON, ACC(––) begins accelerating the port 2 pulse output at about 500 Hz/4 ms until it reaches the target frequency of 20 kHz.