Our online shopping is experiencing intermittent service disruptions.

Support teams are actively working on the resolution.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i stop my normal code when the event structer code is running for a traffic light

Solved!
Go to solution

Hi badooro,

 


@badooro wrote:

can you please help me with the code, … I have no clue how to do it I tried and tried but I have no experience in LabVIEW just super basic stuff


What have you tried so far? Where are you stuck?

Mind to share your VI(s)?

 


@badooro wrote:

due date is 2moro


Whatever "2moro" means: what did your teacher say about your code?

Any results yet?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 17
(295 Views)

hi GerdW

sorry I meant by 2moro (tomorrow), so today is my due date and I gave up on the push button and timer idea but if u can help me with the timer I won't 
say no, my task is I should create a traffic light of my choice based on a real one and then add extra stuff to it to make it safer and faster for cars, etc So I extended the green light time and added a pedestrian walk with no button and I want to add a timer display the time left until the traffic light switch cooler it should be countdown if u can help me with the code I would appreciate that 


and I didn't show my last code to the teacher so no results 

Bader

0 Kudos
Message 12 of 17
(290 Views)

Hi Bader,

 

as some of us (including me) don't use the latest LabVIEW versions you should downconvert your VI so we can open it. (File->Save for previous).

I prefer LV2019…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 17
(285 Views)

hi

sorry about that i wish u can open it now 

0 Kudos
Message 14 of 17
(280 Views)

Hi Bader,

 


@badooro wrote:

sorry about that i wish u can open it now 


I could open the VI now.

 

But: I will not edit this monster!

  • You are using several flat sequences in parallel inside the same loop, with way too much local variables and ALL terminals are unused…
  • Lots of coercion dots: WHY?
  • Your teacher should have told you the very basics of LabVIEW before you got your homework!
  • With your current approach you will never get any useful countdown timer.
  • You should implement all your requirements using a state machine, then all the rest becomes VERY easy…
  • Please don't get into the habit of coloring the block diagram background with gray or dark purple for no good reason…
  • Use type definitions for clusters (like a cluster for a single traffic light) and an array of those clusters for "combined" traffic lights (like your "traffic light 1". Use that type definition also for all block diagram constants…

I'm sorry, I cannot help you with your current VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 17
(272 Views)

Hi GerdW

I figured I made a mess, but I had no idea it was that bad i attached a photo of what they taught us in class 
so the teacher explained how to this shape and then proceeded with the project I ended up like this so I had no way of learning the proper way I guess.


and thank you for giving me some of your time and checking my code.

best regard,
Bader

badooro_0-1702997885169.png

 

0 Kudos
Message 16 of 17
(267 Views)

@badooro wrote:

Hi GerdW

I figured I made a mess, but I had no idea it was that bad i attached a photo of what they taught us in class 
so the teacher explained how to this shape and then proceeded with the project I ended up like this so I had no way of learning the proper way I guess.


and thank you for giving me some of your time and checking my code.

best regard,
Bader

badooro_0-1702997885169.png

 


OMG it's the blind leading the blind.  One thing I will say about LabVIEW is that it makes it really easy to generate bad code.  Whoever wrote this would've greatly benefited from doing the training mentioned on the main forum page.  The fact that there are lessons devoted to the flat sequence structure makes me wonder what other bad LabVIEW practices they are teaching you.

 

Of course you could use this lesson to teach you everything you should not do.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 17 of 17
(232 Views)