Blinking light

cmcc60

Member
Join Date
Jun 2002
Location
carthage,TX
Posts
3
I am working on a program for class and the instructor is out of
town so I was wondering if anybody here can help. We use the Allen-Bradley PLC5 using DOS to program. I have a clock using a timer for the seconds, a counter(minutes), and another counter(hours). The accumulated values are MOVED to the 3 seperate INTIGER files. I use compare instrutions to turn 2 lights on but I do not know how to make light 3 blick for 15 minutes at 10:00.
 
You need to dig a little deeper in the manuals, I havent used A.I. 6200 in a long time but if I am not mistaken the PLC5 offers a RTC (real time clock) that can be accessed by Status bits...S21?? I think. All the manuals etc are at http://www.ab.com.

Anyway I leave it to your imagination how to use a clock to make it start the sequence that makes the traffic light blink.

If you arent allowed to use a clock but are suppose to use timers/counters then please step back because this post will self destruct in 60 seconds.
 
Think the conditions through out loud. For the sake of argument, your three registers are
N7:1 HOUR
N7:2 MINUTE
N7:3 SECOND

You want the light to begin blinking when the HOUR register is EQUAL to 10. You want the light to continue blinking while the MINUTE register is LESS THAN OR EQUAL TO 15.

That gives you two comparison instructions you can use as preconditions to the blinking light.

Code:
   +----------------+        +----------------+
---| EQU            |--------| LEQ            |------
   | Source A  N7:1 |        | Source A  N7:2 |
   | Source B    10 |        | Source B    15 |
   +----------------+        +----------------+

As for the condition to make the lamp blink... you didn't say how fast so I'll leave that as your next exercise.
 
Ken Roach said:
Think the conditions through out loud. For the sake of argument, your three registers are
N7:1 HOUR
N7:2 MINUTE
N7:3 SECOND

You want the light to begin blinking when the HOUR register is EQUAL to 10. You want the light to continue blinking while the MINUTE register is LESS THAN OR EQUAL TO 15.

That gives you two comparison instructions you can use as preconditions to the blinking light.

Code:
   +----------------+        +----------------+
---| EQU            |--------| LEQ            |------
   | Source A  N7:1 |        | Source A  N7:2 |
   | Source B    10 |        | Source B    15 |
   +----------------+        +----------------+

As for the condition to make the lamp blink... you didn't say how fast so I'll leave that as your next exercise.

I understand the preconditions (I had that part) but I am not sure how to get the light to blink lets say at 1 second intervals. If my understanding is right I will have to change one of the bits from 1 to 0 every second with some instruction.
 
I'm not sure about the PLC5, but may PLCs have pre-established bits that automatically cycle off to on to off every second, or every minute, or such. Check your manuals. If you can't find that, you can build your own in a variety of ways. One, for example, is to use two timers, with the done bit of each timer re-setting the other. For learning purposes that is what I would suggest you try.
 
offtopic.gif


It's always difficult to know how best to instruct a student.

On one hand, they need to be thought how to reason out the problem.

One the other hand, I remember my own learning experience, and having a 'library' of simple, common functions was invaluable. The library grew, and the code fragments in it got combined in increasingly imaginative ways.

<hr>

Anyway.....

What you want is a bit that "blinks". That bit (perhaps with other conditions) will drive your output.

Thre are two ways to make a bit "blink". You can use a self-resetting timer (using the NOT of the .DONE bit of the timer as it's condition). This timer will run for the entire duraion of ON+OFF. But you are only interested in the ON part. So do a compare of the Timer ACCulator being less than the ON time.

The second way is to use two timers, one for the ON time, one for the OFF. The ON timer runs as long as the OFF isn't DONE. The OFF timer doesn't start until the ON is DONE.

I was going to draw the code, but I'm pressed for time, and it satisfies the student dilemma above. That should be enough for the student to move ahead, without given away the store.

One last hint: If you use a seperate "blinking" bit, it's OK for that bit to blink continuously, even though the output isn't on.



Ron: AB DOS doesn't necessarily mean 6200. AI is also DOS based.
 
Last edited:
I havent used A.I. 6200

CORRECTION

I havent used A.I./6200 or should it be A.I., 6200???

I know they are dos based and both could be applied to original question. Seems to me there were some differences but its been too long for me to remember (it wasnt 5 minutes ago or less).

I havent looked real hard but I thought I had done something once or twice using RTC in a plc5 which was similar to the question. Maybe I was thinking incorrectly, nothing unusual there.
 
one other way to make the light blink is to look at your three integers from Ken's example. How often do the values change?

N7:1 changes once per hour
N7:2 changes once per minute
N7:3 changes once per second

So, if you want something that toggles once per second, N7:3 is your answer.

Break down how N7:3 is storing the seconds by viewing the data in a binary radix and I will bet that you find a bit in there that is toggling on and off at a 1 second rate. Use that bit with an Examine On or Examine Off to flash.

Of course this only works with a 1-second flash rate. If you need a different rate then a timer will be necessary. Just one though, two are not necessary, even for different on and off rates. But I will make you think about that one.

Also, the PLC5 does have an internal clock but no "flashing" bits like the SLC500.

OG
 
PLC5(Enhanced) if I'm not wrong have a 1 Second internal clock bit, the address is S:23/0, you can put either a XIC or XIO is series of your conditions and output to make it blink at one second. đź““
 
Nothing personal to anyone but regarding the original post and my original reply I didnt think making something "blink" at 1 second intervals would be that hard...am I wrong?

The issue I looked at (and if my conception is wrong I need to know please) was that at 10:00 ie o'clock that it must "blink" for 15 minutes at 1 second intervals.

The post stated PLC5 were being used, therefore I thougt it would make more sense to use the RTC to start the "blink" sequence at 10:00 then stop at 10:16.

Maybe the class requirement was to use integer files to make a clock but this method is not accurate because the timers or whatever have to be reset (when the limit is reached) which creates a loss of time. Again this is my conception and please state if its wrong.

As far as using timers to make something "blink" isnt that easy enough with two (2) timers...ie a basic flip/flop?

Overall wouldnt this be a viable solution? Use the RTC (not sure which Status file bit(s) but know they are there) to start the sequence at 10:00 then use 2 timers to flip flop till 10:16?

I know that the older PLC5 didnt have the free running clock similar to the SLC500/ML or the same abilities as the newer enhanced PLC5 so didnt suggest those options since this was a DOS based system.

I know how and know "words" but if there was a genie that truly gave a person a "wish" then for me it would be the ability to express what I am thinking/saying/know how to do. Some of you are so lucky, you not only know HOW to DO but can express it well, some of you are even artists in the expressing.
 
One of the dangers of threads like these is that we tend to hijack a thread and talk not necessarily about what the original poster was asking, but instead respond to someone else's post.

Your comment about using the RTC in the PLC5 is dead on perfect. That would be the quickest and easiest way to accomplish this task.

However, the original post did mention Integer files and that this was an assignment from a class. This leads me to believe that the instructor is trying to get the student to use what they have learned on timers and comparison type instructions.

The RTC is handy but in a class format you are probably hoping to learn how to do this with timers on any PLC, not just how to do it with a PLC5.

The original message also mentioned that they had the "preconditions" and were just stuck on the flashing part.

As you can see from the variety of posts, there are many ways to accomplish this particular task and lots of people eager to post their way to do it.

OG

oh, don't forget turning on at 10:00 and off at 10:16 would be 16 minutes not 15. That zero catches everyone.
 

Similar Topics

I have a Micro820, yes I know they are hated. I have a brand new Micro820 that I programmed with a Micro SD Card. Once I got it programmed, I...
Replies
5
Views
881
Hello everyone. I have a bunch of e300s connected to a startix which is then going to the plc. All of them are showing their MS and NS lights...
Replies
12
Views
4,486
Hey everyone, Trying to bench test the I/O on a program that I converted from a PLC-5 processor to a ControlLogix processor but still using the...
Replies
21
Views
6,505
Hey Folks, I have a customer with an older machine that is controlled with a MicroLogix 1000. The machine just quit working. The power light is...
Replies
22
Views
10,547
Hey, New to the forum so apologise if I break any rules. I am trying to write a program insturctured text that will allow me to flash a warning...
Replies
8
Views
16,683
Back
Top Bottom