beautypg.com

Flags function, Sample program, 2 instructions – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 360

background image

2 Instructions

2-324

CP1E CPU Unit Instructions Reference Manual(W483)

Flags

Function

PULS(886) sets the pulse type and number of pulses specified in T and N for the port specified in P.
Actual output of the pulses is started later in the program using SPED(885) or ACC(888) in independent
mode.

Note

An error will occur if PULS(886) is executed when pulses are already being output. Use the differentiated

version (@PULS(886)) of the instruction or an execution condition that is turned ON only for one scan to
prevent this.

The calculated number of pulses output for PULS(886) will not change even if INI(880) is used to change

the PV of the pulse output.

The direction set for SPED(885) or ACC(888) will be ignored if the number of pulses is set with

PULS(881) as an absolute value.

It is possible to move outside of the range of the PV of the pulse output amount (-2,147,483,648 to

2,147,483,647).

PULS instruction can be used only with transistor output type of CP1E N/NA-type CPU Unit.

In case of transistor output type of CP1E E-type CPU Unit or relay output type, NOP processing is
applied.

Sample program

When CIO 0.00 turns ON in the following programming example, PULS(886) sets the number of output
pulses for pulse output 0. An absolute value of 5,000 pulses is set. SPED(885) is executed next to start
pulse output using the pulse + direction method in the clockwise direction in independent mode at a tar-
get frequency of 500 Hz.

Name

Label

Operation

Error Flag

P_ER

ON if the specified range for P, T, or N is exceeded.

ON if PULS(886) is executed for a port that is already outputting pulses.

ON if PULS(886) is executed in an interrupt task when an instruction controlling pulse output is being executed in a

cyclic task.

OFF in all other cases.

@PULS

#0000

#0000

D100

0.00

@SPED

#0000

#0101

D110

1388

0000

D100

D101

01F4

0000

D110

D111

Pulse output: 0

Pulse type: Relative

Pulse output: 0
Pulse + direction output
Direction:
CW in independent mode

Number of output pulses: 5,000

Target frequency: 500 Hz

This manual is related to the following products: