PWM(Pulse width modulation)

PWM(Pulse width modulation)

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@

D

Int.

Error

Zero

Carry

PWM

S1

-

-

-

-

-

-

5

O

-

-

S2

-

-

-

-

-

-

D1

-

-

-

-

-

-

 

 

D2

-

-

-

-

-

-

 

 

-

 

 

 

S1

ON time(ms) or the number of the device where the ON time is stored (BIN 16bit)

S2

주기(ms) or the number of the device where the frequency is stored (BIN 16bit)

D1

Device where the internal time is stored (64bit)

D2

Number of the device to which pulses are ouput (bits)

 

Supported PLC series & Version

 

XPnF

CPnF

XPnE

CPnE

XPnB

PLC-S

BP

XPnA/1R

CP3A/B/P/U

CP4A~D/U

v6.13

-

-

-

v6.14

v6.14

-

-

-

-

 

PWM

Outputs the pulse of the cycle set by S2, for the amount of time ON designated by S1, to the output module designated by D2.

Since the timer value for operation is saved in the 1, if you change it, the undesired result may occur.

Scale Value of S1, S2

The value of S1 must be less than or equal to the value specified by S2.

The instruction is not processed in the following cases :

  • When both S1 and S2 are 0

  • When S1 > S2

 

Program

The following program outputs a 100ms pulse once each second to Y20 when X0 is ON.