Strip floating point number apart for compare

Better to add 0.499999 (5 9s for SLC and 6 for PLC5) to it then convert to Integer. That will force the SLC to round it up or down properly. Then subtract that from the original floating point number.
Used to do this all the time for calculating the day of the week based on the Julian date.
 
Better to add 0.499999 (5 9s for SLC and 6 for PLC5) to it then convert to Integer. That will force the SLC to round it up or down properly. Then subtract that from the original floating point number.
Used to do this all the time for calculating the day of the week based on the Julian date.

May i ask where you ca me up with this? I mean how did you com up with adding 5 9s or 6 9s to it?

Would just like to understand the mechanics behind it?
 
May i ask where you ca me up with this? I mean how did you com up with adding 5 9s or 6 9s to it?

Would just like to understand the mechanics behind it?


Just trial and error over the years as we progressed from PLC5 to SLC 500. Of course Logix 5000 has new code and a proper clock so that type of codes not needed anymore. But there is a slight difference between PLC 5 and SLC when converting from floating point to integer.
 

Similar Topics

No trivial trains and tunnels this time! This is an actual problem that was solved about 20 years ago by one of our engineers. The goal is to...
Replies
25
Views
6,089
Hello Experts; Good day. I have strip chart OPC version 1.4.1.6. I have RSLOGIX version 13 to 309Studio 5000). I have RSLINK LITE version 4.0...
Replies
0
Views
1,227
Hi, Just wondering what everyone uses for terminal strip labels? We have an old Roland DXY-1150 plotter with ACS (Murrplastik) software that...
Replies
8
Views
2,109
Dears I have cold roll coil and need to control it after rewinding using any analog sensor to detect edge position and then send its signal to...
Replies
2
Views
1,222
Does anyone make a brush on insulation to put on the exposed end of a terminal strip jumper bar that has been cut down to size? Although these...
Replies
14
Views
5,147
Back
Top Bottom