beautypg.com

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

Page 346

background image

2 Instructions

2-310

CP1E CPU Unit Instructions Reference Manual(W483)

Changing a PV (C = 0002 hex)

Stopping Pulse Output (P = 0000, 0001 or 1000 hex and C = 0003 hex)

If C is 0003 hex, INI(880) immediately stops pulse output for the specified port. If this instruction is exe-
cuted when pulse output is already stopped, then the pulse amount setting will be cleared.

Sample program

When CIO 0.00 turns ON in the following example, SPED(885) starts outputting pulses from pulse out-
put 0 in Continuous Mode at 500 Hz. When CIO 0.01 turns ON, pulse output is stopped by INI(880).

i

Port and mode

Operation

Setting range

Pulse output (P = 0000 or 0001 hex)

The present value of the pulse output is
changed. The new value is specified in NV and
NV+1.

Note This instruction can be executed only

when pulse output is stopped. An error
will occur if it is executed during pulse
output.

8000 0000 to 7FFF FFFF hex
(-2,147,483,648 to 2,147,483,647)

High-speed
counter input (P =
0010 to 0015 hex)

Linear Mode

Differential inputs,
increment/decre-
ment pulses, or pulse
+ direction inputs

The present value of the high-speed counter is
changed. The new value is specified in NV and
NV+1.

Note An error will occur for the instruction if the

specified port is not set for a high-speed
counter.

8000 0000 to 7FFF FFFF hex
(-2,147,483,648 to 2,147,483,647)

Increment pulse input

0000 0000 to FFFF FFFF hex
(0 to 4,294,967,295)

Ring Mode

0000 0000 to FFFF FFFF hex
(0 to 4,294,967,295)

@SPED

#0000

#0100

D100

01F4

0

0.00

@INI

#0000

#0003

0

0.01

D100

D101

Pulse output 0

Target frequency: 500 Hz

Pulse output 0

Stop pulse output

(Not used.)

Pulse + Direction output, CW, Continuous Mode

This manual is related to the following products: