Houston we have a problem

mastabfly1

Member
Join Date
Jun 2005
Posts
11
Okay I have a project that I'm trying to complete. I have 5 flip switches and each one turns on a light. What I want to do is if I were to flip 2 or more switch at the same time, I want the light to come on one at a time.

What I have right now is that I have assigned a binary value to every switch and if any of them is high then it turns on the light.

Any suggestions how to approach it?
 
"At the same time" - unless you are incredibly gifted the switches probably make at least 1 program scan apart, though they could come on in the same scan. Therefore probably the lights are coming on "one at a time" just a couple of hundreths of a second apart.

Do you possibly mean that one light will come on then some noticable amount of time later another light? Do you want the first light to go off at that point? Please define more exactly what you want.
 
1. What plc?
2. Must the lights come on in the same order that the switches were made, or any order with a pause in between?

If the order isn't important, just use a counter, a timer, and indirect addressing.
 
1. I want to have 5 seconds between the lights to come on
2. I am using Mitsubishi Melsec-A
3. Yes, the order does matter
 
1. I want to have 5 seconds between the lights to come on
2. I am using Mitsubishi Melsec-A
3. Yes, the order does matter
1. Do you want a five second delay each time an additional lamp is lit? Or, do you want the whole sequence to take five seconds.

3. In what way does the order matter? Do you want the lights to turn on in numerical order (1-5)? or the same order in which the switches were turned on?
 
another question...

The duration of the 5 seconds starts when?
As soon as one switch is activated or when another switch is activated? If you have one switch on, lets say for 2 seconds, then another switch is activated does your timer now only give you 3 more seconds or a full 5?

PS... Btw, you have done nothing if you have only lined up your I/O... Show some work here, give us more to help you with understanding...

If you give a man fish he'll eat for a day, if you teach him how to fish he'll eat for a lifetime... (food for thought)
 
Last edited:
here is a suggested starting point:

Five switches = 00000 to 11111 (31 binary).
Five lights = 00000 to 11111 (31 binary).

write the five switches to individual bits in a single word. If no outputs are on, write the word contents to the outputs. If any single output is on, wait for a period of time, then write the contents of the word to the outputs.

Try constructing a ladder around that.
 
...fly...

No one can become much of a programmer until he first learns how to properly define a problem.

Your description of the problem is too vague.

If the switch sequence goes as follows, what do you expect to have happen?

12345
00000
01000
01010
01011

Since you say that the order matters... how does this play with your order?

If all 5 switches were to go on at exactly the same time, what would you expect to see? Describe the light number order and the delays between.

For example, if all switches go on at once...

12345
00000
11111

Light-1 ON
5-sec delay
Light-2 ON
5-sec delay
Light-3 ON
5-sec delay
Light-4 ON
5-sec delay
Light-5 ON

If your order is 1,2,3,4,5... and switches 3,4,5 are turned ON,

12345
00000
00111

I should expect Light-3 to go on immediately. However, if switches 1 & 2 are then turned on, before lights 4 & 5 go on... what do you expect to have happen? Does your order-priority come into play somehow?

C'mon, fly... ya gotta put a little into it... we simply can not read your mind!

And PLEASE... don't start a new thread with your response. Do it here.
 
DanielCamacho said:
If you give a man fish he'll eat for a day, if you teach him how to fish he'll eat for a lifetime... (food for thought)


mmm i was always taught..."If you give a man fish he'll eat for a day, if you teach him how to fish he'll sit in a boat and drink beer all day"...:)
 
Now here is a program that I wouldn't mind writing.

Wish I could get some $$$ for it.

regards.....casey

NOTE:

I did not take any money for the last two stoplight programs I wrote. I didn't think it was fair, when I couldn't come up with a supplier for the thermo-nuclear powered crosswalk sounder alarm.
 
Last edited:

Similar Topics

Anyone here at Rockwell Automation Fair in Houston?
Replies
18
Views
7,246
body Attached are a few pictures of AVS Reclaim Furnace and control cabinet The I/O configuration Slot # 2 Analog Input 4 ch IC693ALG220f...
Replies
6
Views
2,137
The project on the operator workstation keeps disconnecting, even though I have an installation server and operating station set up through...
Replies
0
Views
54
I have a problem, I'm running an AE Licence Manager on a Windows 2016 Server, and my Window Maker is on another separate Windows 2016 Server. My...
Replies
0
Views
76
I have one old Ansaldo VFD from 37kW and it have only sign OFF on the display after put it on the 3x400VAC. Is there any idea, how to solve this...
Replies
1
Views
78
Back
Top Bottom