Micrologix 1400 Accurate Time Counting

Sombrero

Member
Join Date
Jul 2016
Location
Acuna
Posts
17
Hello guys!! :site:

My question is, what is the most acurate way to count time of an action from the plc. I am currently using a 1000 ms timer which resets itself, and also counts the seconds, minutes and hours of the action (until it finishes its cycling action). But my HMI shows that the estimated time is not the same as the elapsed time.

Example, cycling process is estimated in 30 min, but shows 29 min and 58 seconds. Currently working with CIRCUIT 1 section.

Any suggestions?

Including PLC program:
 
Last edited:
Sounds like your tag in the HMI is not set correctly, if your timer ACC is showing what you want but your HMI is not then its the tag
 
Sounds like your tag in the HMI is not set correctly, if your timer ACC is showing what you want but your HMI is not then its the tag

What my HMI shows are float values for seconds, minutes and hours, each of them add to themselves when the seconds timer finishes its 1000 ms time lapse. So I dont think the HMI is the problem. I use a G315 Redlion HMI.

Here's my CD3 file:
 
The most accurate way is to use a real time clock module.
A timer resetting itself every second will be off by up to 2 cycle times per second.
A more accurate way would be to have a 30 minute timer and do math on the T0.ACC register.
 
WAG and going from old **** memory...I seem to remember the Micrologix timer advancing [ACC] at 2 second interval and it was discussed on the forum.
HTH
 
WAG and going from old **** memory...I seem to remember the Micrologix timer advancing [ACC] at 2 second interval and it was discussed on the forum.
HTH
Actually it's the real time clock which does that (counts by 2).

Timer overrun can and will occur when using the classic self resetting timer rung. There are ways to alleviate some of that, but it still won't be bullet proof. Here is what I do to capture any timer overrun. It's from a different PLC with a different timebase, but the concept is the same...if your accumulator has a few counts greater than the preset, they get preserved by the SUB rather than erased by a RESet.

Also, your cd3 file has an untranslated program and it generates a data type mismatch error when I try to translate it.

Timer_Overrun_000.png
 
Last edited:
you can use a timer, but rather than resetting the timer, subtract 1000 from the accumulator. If you reset the timer, at least 1000 milliseconds have to pass for the DN bit gets turned on. it could be 1000, but could also be 1015, 1003, 1008. It depends on how much time has passed since it last ran, but it liking isn't going to be exactly 1000 milliseconds. Then you also lose time between seeing the DN bit get set, and the time between resseting the clock.

If you subtract 1000 from the accumulator, that clears DN bit. Then when about a minute has passed accumulator will reach/pass 1000. The DN bit will get set, but it could be more or less that 1000 milliseconds since the last time 1000 was subtracted, but overall, it will be an average of 1000 milliseconds.
 

Similar Topics

I'm using a SLC typed write from the ControlLogix5572 to the MicroLogix 1400, with path: 2, (MicroLogix IP). The ControlLogix equipment has a...
Replies
0
Views
86
Hi, I am working with a Micrologix 1400 model 1766-L32BXB. With no input wires connected to the “in12” thru “in19”, I am getting 24 volts while...
Replies
4
Views
221
Hi everyone, I hope I don't butcher this up, please feel free to critique me wherever if I do, I have an issue I would equate to "chasing...
Replies
4
Views
297
Hi everyone, I'm working on a project where I need to exchange data between a Siemens S7-1200 PLC and an Allen-Bradley MicroLogix 1400 PLC. The...
Replies
8
Views
621
I'm not super familiar with the Micrologix line of processors, but I am pretty familiar with RSLogix 500. I'm trying to simply copy a string to...
Replies
4
Views
302
Back
Top Bottom