LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView Traffic Light

IMG-2033.jpg

 

 

 

I am trying to see if anyone can show me how to do this experiment?? I have tried for hours and cannot at all. I'll give whatever. Thanks in advance.

0 Kudos
Message 1 of 6
(2,621 Views)

Try to use a Case structure inside a For loop to implement the sequence.  If you remember how timers work you'll have an easier time timing the sequences.  Although, you won't be able to interrupt it if you're not careful.

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 6
(2,612 Views)

@JoeCone95 wrote:

 

 

 I have tried for hours and cannot at all. I'll give whatever. 


Can you post what you have tried so far?  Right now it looks like you're asking us to do your homework, which we won't do.  But if you've tried with a genuine effort, we will point out what mistakes you have made so far.

 

It doesn't matter if it doesn't even run at all, just something to show us some effort and a more specific problem.

 

Posting a VI is better than posting a screenshot.  Posting both is the best option.  

0 Kudos
Message 3 of 6
(2,589 Views)

This looks like a good project for a simple State Machine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(2,569 Views)

Sorry, but I've actually been trying. My friend did his with local varibles but that way is too difficult so I have decided to try another way. It's fine if you dont trust me or complete the question. I just need a little morte help than others. Capture.PNG

0 Kudos
Message 5 of 6
(2,559 Views)

A few tips:

  • Search the forum for traffic lights. I am sure there are plenty of examples, especially in the certification forum.
  • As a first step, do a few simple LabVIEW tutorials.
  • As a second step, program it as a simple simulation to work out the logic. No external hardware, just the LEDs on the front panel. Once this is fully functional, adding the hardware is trivial!
  • "Index array" is resizable. You only need once instance. Why are the even there? You don't have any arrays!
  • Why do you need the FOR loop if you are already spinning the while loop at regular intervals?
  • Define a reasonable loop rate for the while loop.
  • All your indicator belong inside the while loop after the case structure.
  • There is no need to NOT the boolean, you can just swap the cases.
  • Your channel constant belongs outside the toplevel loop. It never changes.
  • A state machine has been suggested. think about how many states you have and create an typedef'd enum, keep the state in a shift register and wire it to the case structure. Create a case for each state.
  • If you want help, it is better to attach VIs instead of pictures. What's in the other case?
Message 6 of 6
(2,506 Views)