Specifications
SIMATIC Instructions
9-60
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
PTO Initialization - Single Segment Operation
To initialize the PTO, follow these steps:
1. Use the first scan memory bit (SM0.1) to initialize the output to 0, and call the
subroutine that you need to perform the initialization operations. This reduces
scan time execution and provides a more structured program.
2. In the initialization subroutine, load SMB67 with a value of 16#85 for PTO using
microsecond increments (or 16#8D for PTO using millisecond increments).
These values set the control byte to enable the PTO/PWM function, select PTO
operation, select either microsecond or millisecond increments, and set the
update pulse count and cycle time values.
3. Load SMW68 (word size value) with the desired cycle time.
4. Load SMD72 (double word size value) with the desired pulse count.
5. This is an optional step. If you want to perform a related function as soon as the
pulse train output is complete, you can program an interrupt by attaching the
pulse train complete event (Interrupt Category 19) to an interrupt subroutine,
using the ATCH instruction, and executing the global interrupt enable instruction
ENI. Refer to Section 9.16 for complete details on interrupt processing.
6. Execute the PLS instruction to cause the S7-200 to program the PTO/PWM
generator.
7. Exit the subroutine.
Changing the PTO Cycle Time - Single Segment Operation
To change the PTO Cycle Time in an interrupt routine or subroutine when using
single segment PTO operation, follow these steps:
1. Load SMB67 with a value of 16#81 for PTO using microsecond increments (or
16#89 for PTO using millisecond increments). These values set the control byte
to enable the PTO/PWM function, select PTO operation, select either
microsecond or millisecond increments, and set the update cycle time value.
2. Load SMW68 (word size value) with the desired cycle time.
3. Execute the PLS instruction to cause the S7-200 to program the PTO/PWM
generator. The CPU must complete any PTO that is in process before output of
the PTO waveform with the updated cycle time begins.
4. Exit the interrupt routine or the subroutine.