LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two sub VI's inside a VI collecting data simultaneously

Hello,

I have two VI's which collect real time data from devices & stores them in Excel file.I want a Main VI which has these two VI's as subVI's & when i run the main VI the two SubVI's should also run at the same time.Awaiting a reply,

 

Labstar

LV8.5

0 Kudos
Message 1 of 17
(4,077 Views)

Sounds good... but whats your question?

Do the subVI's collect data at the same rate?

Or are you having trouble converting the VIs into subVIs?

Cory K
0 Kudos
Message 2 of 17
(4,068 Views)

HI cory,

 

I dont know how to build two subVIs & make them run in the main VI,yes the VI's collect the data at the same rate.Can you help me by giving a sample VI which has two subVI's in it,so that i can try to follow it?

 

Labstar

Lv8.5

0 Kudos
Message 3 of 17
(4,062 Views)
0 Kudos
Message 4 of 17
(4,050 Views)

Hey there,

 

I hope it's o.k. to just jump in with another question here but it has to do with the topic of this thread.

I'd consider myself relatively experienced with labview, but I can't figure this one out:

I have one sub VI (VI#1) acquiring voltages at a specific rate and another sub VI (VI#2) sending out a voltage to trigger an event. 

What I want to do is start acquiring the data with VI#1 and 10 ms later trigger the event with VI#2 (means while my event triggered by VI#2 is happening, VI#1 should still take data).

If I place both subVIs in my main VI it's starting VI#1 but it won't trigger the event with VI#2 before VI#1 is done taking data. Is there any way to have both suVI's running parallel?

 

I'd appreciate every response (running labview 7.0)!

0 Kudos
Message 5 of 17
(4,004 Views)
laneli-

Start with a shipping example from Help>>Find Examples.  The one I would suggest is under Hardware Input and Output>>DAQmx>>Synchronization>>Multi-Function>>Multi-Function-Synch AI-AO.vi.  Looking at this VI, it will start both tasks at the same time.  For your application, you will want to start the acquisition task (top task) first then implement a 10 ms wait before starting the generation task (bottom task).  Try this out and see if it will work for your application.
Regards,

Mike S
NI AE
0 Kudos
Message 6 of 17
(3,978 Views)

Hi , 

   Even I have the same issue. I am generating a signal based upon the system time ( hours , min , sec) and signal width is  based on the time value. This is my time stamp ( synch signal )  which i need to send it to the output analog channel. THen I am acquring few signals including the one which i have sent out. Now when i use DAQ assistant I get a buffer problem. and when i try to use harddware Input and Output>>DAQmx>>Synchronization>>Multi-Function>>Multi-Function-Synch AI-AO.vi then its not working because I have a while loop in my time stamp prog ( loop becuse i need to acquire time from my system every second).

 So, if we have  loop in out prog (  for signla generation ) then cant we use it to both send and acquire the signal.

 

Thanks in advance  

 

ADITYA. 

0 Kudos
Message 7 of 17
(3,955 Views)
Aditya-

For your application, are your generation signals based on your timestamp as in the value changes as the time changes?  If so, this will not work for you.  This example is primarily used for synchronizing the AI and AO for your card.  Your application will need to write to the buffer each time if it needs to output a different value based on the time value. 

You may want to take a look at www.ni.com/code for other people who may be doing something similar to your application.  This is a great resource where lots of people post their code for others to use.
Regards,

Mike S
NI AE
0 Kudos
Message 8 of 17
(3,929 Views)

HI, 

   Yah my time stamp value changes each second based on the system time. I am able to generate and acquire the signal but i m loosing quit an amount of data( around 40 ms per second ) .

So , where can I find any info regarding my application. 

0 Kudos
Message 9 of 17
(3,913 Views)
Aditya-

Are each of your tasks in two separate loops, or the same loop?  I’m having a hard time picturing your application.

Regards,

Mike S
NI AE
0 Kudos
Message 10 of 17
(3,900 Views)