Counter, Timer, One Shots

cooka

Member
Join Date
Jan 2014
Location
MN
Posts
6
Hello All,

I recently posted inquiring about a Real Time Clock, instead I have been asked to create a PLC program that uses Timer, Counter, and One Shots to count the day of the week and time in the day (hh:mm:ss) format and display and display it in as a string file. So I understand how to use TON and CTU - somewhat, still VERY new to PLC programing - in my program I have 3 timers that count up to equal 1 second, 1 minute, 1 hour. I know I need to reset the timers and have the counters count up when each timer gets to the ACC (before it resets). So I am confused about how/why to use a OSR and I don't have a clue as to how to display the Day and Time in a string file.

I am using an emulator for RSLogix 500. I am running this on a vert XP machine that is on a 7 64bit.

I have been searching for day on how to do this but I am just getting more and more lost and confused. If any one could help I would appreciate it greatly. Thank You in advance.
 
You really just need one timer. The longer that timer times, the better it's accuracy will be. So you could setup a timer to time to 60 seconds and then restarts. Then count each time that timer turns on it's done bit. Now you have minutes. Go from there.

What I meant by accuracy was that if you setup the timer to time to 1 second and then count to sixty, it will not be as accurate as one 60 second timer would have been. That is due to the scan time of the controller affecting the timer one time versus sixty times.

OG
 
Ok I understand that, but where do I put in One Shot and why and how do I display the Day and Time. The only thing I have been working on is the Time, I don't even know how to do the Day of the week part, any suggestions?

How do I get my hh:mm:ss in a counter?
 
Walk before you crawl......strike that, walk before you run! I wouldn't worry about Turn 8 at Laguna Seca before I've figured out how to use the clutch.

Get the data first, then worry about assembling it into a string. Your one-shot could be used for a reset. Press a button, pass through a one-shot to trigger a reset. Then you have to let go and press the button again before a second reset would be sent.

How many days in the week are there? What can you use to keep track of a quantity? How do you know when we have gone from one day to the next?

OG


BTW for kicks I just set up a sixty second timer and compared it's results to a 1 second timer triggering a count and stopping at 60 seconds. Then another timer to track the differences.
  • With a program scan time under 1ms there was no recorded difference.
  • With a program scan time of 6ms there was nearly a two second difference
  • With a program scan time of around 25ms there was over a 4 second difference
  • With a program scan time of around 50ms there was a 8.5 second difference
Remember it is only going to 60 seconds and one is off by over 8 seconds from the other. The short time of the 1-second timer was affected by the lengthening scan time and caused it to lose accuracy even with relatively fast scan times.
 

Similar Topics

Hello All, I recently posted inquiring about a Real Time Clock, instead I have been asked to create a PLC program that uses Timer, Counter, and...
Replies
3
Views
2,149
I don't have much experience in programming. I can do simple configuration. it is like this. i want to add something to the existing ladder...
Replies
39
Views
6,205
Hello everyone‚ Fairly new to PLC prog I seek your advise concerning what is said in my thread title; I program using workbench components; I...
Replies
1
Views
1,259
Hello all Logiix designer 5K Been looking around ( not in the right places ) haven't been able to locate an AOI or other instruction for a...
Replies
24
Views
5,433
can you help me with this one guys using fluid sim. This is for my bring home exam. providing a problem description, schematic...
Replies
5
Views
2,458
Back
Top Bottom