ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

very basic timing sequence. Please help

Hi,
  This is a very simple question. I want to have a graph display real time data, while a sequence of LEDS light up for variable amounts of time. I cant simply use a time delay because then the graph pauses as well. I think the best course is to use a timing sequence, but these seem very complicated. How can I configure the VI so that first one LED turns on, then after 4 seconds turns off, so another can turn on, etc, all while the graph displays data?

   I truly appreciate your help.
  David

Message Edited by dzilber on 04-09-2007 09:54 PM

0 Kudos
Message 1 of 9
(4,029 Views)
Try two loops. That's part of the beauty of LabVIEW. Two loops not connected by a wire from one loop to the other will run in parallel. One for the graph data and one to run the sequence of LEDs. No need for a timed sequence if you want to keep it simple. The two loops can run in parallel and different rates to handle separate tasks.
Jarrod S.
National Instruments
0 Kudos
Message 2 of 9
(4,016 Views)
Here is a quick example of two loops that I have posted in forum of China area. Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 3 of 9
(4,012 Views)


Message Edited by dzilber on 04-10-2007 06:08 PM

0 Kudos
Message 4 of 9
(3,998 Views)
Well I dont know how I could run two loops at the same time for my application because The graphed data must happen precisely at the same moment the LEDS fire. Im pretty sure I should use a timed sequence structure, I just dont know how, and cant find any good examples.

Ian, youre response is helpful but I think its in the same direction as Jarrod's. I need two events to happen simultaneously, with one of the two occurring at a specified rate.


0 Kudos
Message 5 of 9
(3,996 Views)
You don't want a timed sequence structure.  You want timed loops.
 
It is unclear as to what you mean by "while a sequence of LEDS light up for variable amounts of time".  What is variable about the times?
 
You could probably do all that you want in a single timed loop.  Allow the graph to update at every iteration.  Use the loop counter, or even the timer functions (is current time >= to start time + 4 seconds?) to determine when to turn on or off the LED's.
 
If you use 2 parallel timed loops and set the properties of the loops to maintain phase, each iteration of each loop shoud occur nearly simultaneously.
 
Another possibility is to use 2 loops and use notifiers, rendezvous's, or other synchronization functions to keep the loops operating together.  But from your description, I don't think you would need to go that advanced.
0 Kudos
Message 6 of 9
(3,989 Views)
Hmm, that sounds like its what Im looking for. Do you have any examples?

Specifically I have a noise generator that must create a constant signal at a constant rate. When a certain button is pushed, the noise generator is swapped with a signal generator. Meanwhile, a sequence of LEDS must fire, each for say 2 seconds. Then the system resets. The problem with making each LED stay on for 2 seconds at a time using the wait function is that it makes the graph pause for 2 seconds as well. See my problem?
0 Kudos
Message 7 of 9
(3,985 Views)
Howdy,

Instead of a Wait, try using the Elapsed Time Express VI. Or, if you don't have that, do it the manual way using the Get Date/Time.

Get Start Time (at the beginning)
Get Current Time (inside the loop)
Elapsed Time = Current Time - Start Time
If Elapsed Time < Stop Time, Turn LED ON
If Elapsed Time >= Stop Time, Turn LED OFF

Repeat as necessary for all LED's.

I can make a block diagram if you need it, but I think you'll get the idea.

B-)
0 Kudos
Message 8 of 9
(3,979 Views)
Try this.
 
New data is created every 1/10 second and updated on an XY graph.  Every 20 iterations (2 seconds), the 2 LED's toggle.
0 Kudos
Message 9 of 9
(3,975 Views)