Question about executing two loops simultaneously 
Author Message
 Question about executing two loops simultaneously

Hi,

I have a problem executing two loops 'simultaneously'.

Let me first describe what I want:

I have one loop that contineously acquires data (at 1kHz) and sends feedback
signals (to the valves at a rate of 50 Hz). On the other hand there's a high
frequency acquirement (at at least 250 kHz) for a duration of, let say, up
to 10 secs.

The high frequency acquirement is not contineous, but it should be executed
at a time that I want to. It should be executed multiple times also.

What I have used is a notifier to execute the other loop at a time that I
want. It's ok when I run the other loop for only 0.5 seconds, but when I do
it for 10 sec. then the other control loop doens't function anymore. The
valves stay at the same opening position because it doesn't get any feedback
from this loop.

How can I fix this problem ?

Many thanks,

Chang-Kwon Kang



Sun, 30 May 2004 08:31:34 GMT  
 Question about executing two loops simultaneously
Chang-Kwon,

I believe that your problem doesn't really lie in the fact that you
have two loops, I think it is rooted in how you are doing your data
acquisition.

First, let me make the assumption that you are using buffered
acquisition for your data (you must be to get 250 kHz).  When you do
your buffered acquisition, are you using DAQ occurrences to see when
the buffer is full (or has a specific amount of data in it) before you
perform your AI Read?

What I'm getting at is when you perform a buffered acquisition, you
call the AI Read VI to get the data out of the buffer and into
labview.  If you ask the AI Read for an amount of data that is not
available in the buffer yet, it will consume the "data acquisition"
thread until the data IS available.  Therefore, any other data
acquisition VI's that you are trying to run will be halted until this
operation completes.

The way to get around this is to use the DAQ occurrence VI.  This VI
will halt until the amount of data is available in the buffer, but it
doesn't consume the data acquisition thread while it is waiting; when
it returns that the data is ready, then you can perform your AI Read.
This allows you to have more than one data acquisition going on in
either one or more loops.

Hope you understood that.  Let me know if I can help you further.

Mark



Sun, 30 May 2004 23:44:39 GMT  
 Question about executing two loops simultaneously
Mark,

thanks for your kind answer.

I think I get what you mean. I'll try to use DAQ occurence VI.

Thank you again,

Chang-Kwon


Quote:
> Chang-Kwon,

> I believe that your problem doesn't really lie in the fact that you
> have two loops, I think it is rooted in how you are doing your data
> acquisition.

> First, let me make the assumption that you are using buffered
> acquisition for your data (you must be to get 250 kHz).  When you do
> your buffered acquisition, are you using DAQ occurrences to see when
> the buffer is full (or has a specific amount of data in it) before you
> perform your AI Read?

> What I'm getting at is when you perform a buffered acquisition, you
> call the AI Read VI to get the data out of the buffer and into
> LabVIEW.  If you ask the AI Read for an amount of data that is not
> available in the buffer yet, it will consume the "data acquisition"
> thread until the data IS available.  Therefore, any other data
> acquisition VI's that you are trying to run will be halted until this
> operation completes.

> The way to get around this is to use the DAQ occurrence VI.  This VI
> will halt until the amount of data is available in the buffer, but it
> doesn't consume the data acquisition thread while it is waiting; when
> it returns that the data is ready, then you can perform your AI Read.
> This allows you to have more than one data acquisition going on in
> either one or more loops.

> Hope you understood that.  Let me know if I can help you further.

> Mark



Mon, 31 May 2004 18:00:20 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Two canvas scrolled simultaneously by the same scrollbar (an UNIQUE scrollbar and TWO or more canvas)

2. Weird problem running two RB apps simultaneously in Win32

3. How to run two vi's simultaneously?

4. error 10843 - underflow error - PCI 6025E - when outputing two waveforms simultaneously

5. DAQ using one PC but two carts simultaneously

6. how to control two 6110e daq cards to acquire 8 signals simultaneously

7. can distutils build simultaneously on two architectures?

8. Scrollbar to control two canvas widgets simultaneously

9. two windows to appear simultaneously

10. Question on Event Loop in two interpreter.

11. Two parts: Email and Tcl/Tk and executing a tcl script

12. How do I execute TWO commands at the same time during the Scroll Up/Down function

 

 
Powered by phpBB® Forum Software