beautypg.com

Rockwell Automation 1775-S4B,D17756.5.3 User Manual SCANNER/MSG HND User Manual

Page 150

background image

Floating Point Values on the 1775ĆS4B Scanner

Appendix B

BĆ9

Rung Number

Description

RS14:

The greater than range counter kept track of how many times we divided

by 10. When the conversion is complete, this corresponds exactly to the

positive exponent. If it has accumulated, move its count into the result

word H0:2 as a positive exponent.

RS15:

The less than range counter kept track of how many times we multiplied

by 10. When the conversion is complete, this corresponds exactly to the

negative exponent. If it has accumulated, move its count into the result

word H0:2 as a negative exponent.
Either C0 or C1 will be > 0, but not both.

RS16:

For the case where the exponent is zero (X E 0), neither C0 nor C1 will

have incremented. Therefore, a value of zero is moved into the result

word H0:2 as an exponent of 0.

RS17:

Return to main program section.

RS18:

If the watchdog counter has counted out, we make F0:0=F0:1 and latch

the conversion fault flag bit.

RS19:

Return to main program section.

RS20:

End of program for subroutine section.

NOTE: Certain floating point values will never come into range. If this
happens, we continue to loop in the subroutine. If we loop too long, the
PLC-3 system watchdog timer will time out shutting down the system.
Rung RS3 provides an automatic safeguard for the condition. If watchdog
counter C2 ever counts 40 loops (a condition indicating a non-convertible
value), we jump to label 5 (rung RS18). Rung RS19 latches on the
conversion fault flag bit, sets F0:0 = F0:l, and the subroutine is exited. It is
the responsibility of the user to increment (bump) the value of F0:0 and to
reset the conversion fault flag bit. Failure to reset the conversion fault flag
bit will cause further conversions to cease and the result words to remain at
the last previously converted value.