in Controllogix the timer.acc function displays time in milliseconds. I was wondering is there a way to convert that time into seconds or minutes even within the program so that I can retrieve that number and display into a web page?
in Controllogix the timer.acc function displays time in milliseconds. I was wondering is there a way to convert that time into seconds or minutes even within the program so that I can retrieve that number and display into a web page?
With a destination of DINT you can have integer values:
.ACC / 1000 = Seconds.
.ACC / 60000 = Minutes.
.ACC / 3600000 = Hours
.ACC / 86400000 = Days
.ACC / 604800000 = Weeks
-----------------------
With a destination of REAL you can have integer+decimal values:
.ACC / 1000.0 = Seconds
.ACC / 60000.0 = Minutes
.ACC / 3600000.0 = Hours
.ACC / 86400000.0 = Days
.ACC / 604800000.0 = Weeks
Use the 'help' file to read about the GSV instruction.
After reading about the instruction itself scroll to the very bottom and click on 'GSV/SSV Objects'. In the next screen click on 'WALLCLOCKTIME'.
You will have to create a DINT array with 7 elements and use it as the target for the GSV instruction. After executing it will contain the current (assuming that the clock has been set correctly) date and time information (LocalDateTime). You can then perform standard comparisons.