Reading a timer output

Prayder

Lifetime Supporting Member
Join Date
Jun 2014
Location
Arkansas
Posts
254
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?

I don't think there is a built in function to do that, but you can of course do the math yourself in the PLC to convert ms into minutes and seconds.
 
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
 
Last edited:
Note that, in RSLogix5000, if the divisor is a REAL then the quotient is rounded.

If you want minutes and remaining seconds then make sure NOT to use a decimal point in the divisor

.ACC / 60000 = minutes

(.ACC MOD 60000) / 1000 = seconds
 
So if I am wanting to reset a timer based off a certain time of the day... how would I go about that?
 
That is a very different subject.

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.
 

Similar Topics

I am trying to set a timer in S7 for 30 seconds. i have blocks that nead to read this accumulated value as it timing, and perform some other...
Replies
13
Views
5,885
Hello I have a s7-1200 and I would like to read the tags present in this controller with my controllogix controller. The two controllers don't use...
Replies
5
Views
99
Hi all, i have 8 CJ2m plc units that show different numbers on the plc display and i am stuck on reading the info. my unit has an ip address of...
Replies
3
Views
92
Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
84
Trying to setup a message read via Ethernet. I have the path setup as 1, 1, 2, 192.168.66.10 I get an error code 1, ext err 315. I am beating...
Replies
9
Views
231
Back
Top Bottom