LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need some help to make automatic turn on LED.

Hello to everyone,

I'm using Arduino to communicate with LabVIEW. I have x4 LEDs attached to the pins 8,9,10 and 13. I'm trying to make the LED attached to pin 8 automatically turn on for an interval of 60s for a duration of 2 secs long. I think i kinda did it after looking at several examples but it is affecting the LEDs on other pins. There is lag of 60s for other LEDs also.

Automatic.PNG

How can I operate this LED on the pin 8 (red boxed) independently i.e. 60s off and 2 sec on without affecting the other LEDs too? Is there any other way to do it? Detailed steps are much appreciated.

Thank you NI team.

0 Kudos
Message 1 of 2
(1,465 Views)

Learn the Principle of Data Flow.  If you have a Structure (such as a While Loop, or a Case Structure, or a sub-VI that you've written), the following "Rules" apply (almost all the time -- sorry to be so wishy-washy):

  • No code "inside" the Structure will start to run until all of the Inputs ("wires going into") the Structure have Data on them.
  • If a Structure has Outputs, no Data will be present on any of them until the Structure exits (at which point, Data appears on all of them).
  • A Structure cannot exit until everything inside it has run.

There are two very important consequences of these Principles:

  • Any two Structures "connected" by a Wire (which carries data of a specified type) such that the Wire goes from the Output of Structure 1 to the Input of Structure 2 will execute sequentially, first Structure 1, then Structure 2.  Let's call this "The Rule of Sequential Execution".
  • Any two Structures that are not connected by a Wire (again, Output to Input, so two Structures sharing Inputs because of a branching Wire are considered as not-connected) execute in no particular order.  In the case of LabVIEW, they can be considered to be executing at the same time.  Let's call this "The Rule of Parallel Execution".

Now look at your Task.  You have some "Sequential" Tasks (LED On for 2 seconds, Off for 58 seconds) and some "Parallel" Tasks (other LEDs having differing On/Off ratios.  Do you know how to do Timing in LabVIEW?  Note that most of the Timing functions on the Timing Palette work as "Parallel" Tasks.

 

Bob Schor

0 Kudos
Message 2 of 2
(1,445 Views)