Description
Use this instruction to control and monitor the pulse width modulation function, which in turn controls the physical PWM output.
PWM files are always included when a program is downloaded or transferred from a memory module.
Note: A maximum of two elements can be configured for the PTO and PWM files combined.
Operation
The PWM function is controlled by a state machine. The rung state when the instruction is executed is only one of several inputs used to control this state machine. Consequently the setting of the EN bit is described next, but the actual operation is described in the PWM State Machine topic.
When executed on a true rung, the PWM instruction sets the EN bit and executes the state machine.
When executed on a false rung, the PWM instruction resets the EN bit and executes the state machine.
Pre-First Pass
1 The EN, NO, ER, ID, AS, RS and DS Status/Control bits are reset.
2 The Error Code is reset to zero.
3 The Current Frequency and Current Duty Cycle are reset to zero.
MCR Zone Execution
In an active MCR zone, the PWM operates as if the rung state were false.
Entering Parameters
Enter a 0 or a 1 for the PWM number. The PWM status and control information is contained in a Pulse Output (PWM) control file or (PWM) function file. A list of requirements regarding the use of the PWM follows:
You can assign outputs O:0/2 and O:0/3 to any of the PTO or PWM functions but, the same output cannot be assigned to more than one function.
There is no restriction on the number of PWM instructions that can be in a program. Each time one of the instructions is executed, it updates the PWM function as described by the PWM state machine.
The output image for the output controlled by the PWM function is updated to reflect the state of the physical output every time that the PWM instruction is evaluated.
If the PWM function is being used, the output image for the output controlled by the PWM function is not transferred to the physical output. This constraint also applies to immediate outputs. The PWM function is being used if and only if a transition out of the Pre-Idle state is made. For example, a PWM instruction may be contained in a subroutine or interrupt file that is never executed, in this case the PWM function is not used Immediate outputs update the output image (but not the physical output.)
If the output controlled by the PWM function is forced, the force overrides the PWM and the PWM errors out as described in Faults Generated.
When the PWM is in the Idle or Error state, the output controlled by the PWM is off (unless a force overrides the physical output.)
If the PWM instruction is being used when a power fail occurs, the corresponding output image are set to zero.
Note A maximum of two elements can be configured for the PTO and PWM files combined.
The ML1200/1500 Instruction Set Reference manual will explain more:
http://www.ab.com/manuals/cp/1762-rm001e-en-p.pdf
AB offers Quick Start guides for using PWM:
http://domino.automation.rockwell.c...671BC67B52C8AEE385256AFB00672734?OpenDocument
http://domino.automation.rockwell.c...6061C1E42EFF91DE85256AFB0069FF7F?OpenDocument
Rockwell Software 2000