Publication 1763-RM001C-EN-P - October 2009
How to Use 40kHz PTO/PWM of MicroLogix 1100 Series B Controller
577
•
DIV/SCP Instruction
The operands of DIV and SCP instructions work as signed value, but JF,
OF, OFS of PTO/PWM are unsigned 16-bit variable at MicroLogix 1100
Series B controller. Therefore, these instructions could cause undesired
results when JF, OF and OFS of PTO/PWM values are greater than 32767.
For example, assume the PWM:0.OF value is 40000 (9C40h) and a user
wants to divide it by 2. The expected result is 20000, but the actual return
value is -12768 because DIV instruction recognize 9C40h as -25536.
To solve this issue, JF, OF, OFS of PTO/PWM type should be changed to
Long Type (32-bit) by CPW instruction before the execution of these
instructions as shown below.
•
NEG/ABS Instruction
The operands of NEG and ABS instructions work as signed value, but JF,
OF, OFS of PTO/PWM are unsigned 16-bit variable at MicroLogix 1100
Series B. Therefore, these instructions could cause undesired results when
JF, OF and OFS of PTO/PWM values are greater than 32767. If PTO:0.JF is
40000, the expected NEG result is -40000 and the expected ABS result is
40000. However, the actual results are 25536 both because both NEG and
ABS instruction recognize 9C40h as -25536.
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive