K
K
K
K inco
inco
inco
inco -K
-K
-K
-K S
S
S
S series
series
series
series
31
• Select 1 μ s as the time base
• Allow u pdating the pulse number
2) Set SMD72 according to desired pulse number.
3) Execute the
PLS
in struction to configure PTO0 and start it, then a new PTO with the updated pulse
number shall be generated.
�
�
�
� Execute
Execute
Execute
Execute the
the
the
the PTO
PTO
PTO
PTO (Multiple-Segment
(Multiple-Segment
(Multiple-Segment
(Multiple-Segment Operation)
Operation)
Operation)
Operation)
1) Set control byte SMB67 according to the desired operation.
For example, SMB67 = B#16#A0 indicates:
• Enable the PTO/PWM function
• Select PTO operation
•
Select multi-segment operation
• Select 1 μ s as the time base
2) Set an odd number as the starting position of the profile table into SMW168.
3) Use V area to configure the profile table.
4) (Optional) Use ATCH to a ttach the PTO0-complete event (event 28) to an interrupt routine to respond in
real time to a PTO0-complete event.
5) Execute the
PLS
instruction to configure PTO0 and start it .
2.3.3.3
2.3.3.3
2.3.3.3
2.3.3.3 PWM
PWM
PWM
PWM Operations
Operations
Operations
Operations
Following takes PWM0 as an example to introduce how to configure and operate the PTO/PWM generator in
the user program.
There are two procedures for using PWM: Configure related control registers and initialize PTO. Execute
PLS instruction.
Use SM0.1 (the first scan memory bit) to call a subroutine that contains the initialization instructions. Since
SM0.1 is used, the subroutine shall be executed only once, and this reduces CPU scan time and provides a
better program structure.