LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reentrant data collection

So what I am trying to do is develp a system that collects data syncronoysly on the RT, and stores it in a FG so that it can be used by mutiple threads in this multithreaded application.  

 

This will ultimatly be a part of a very large application that runs a main control loop at 10khz on a RT desktop computer with some M series, E sers (legacy customers) and X series cards (possibly as many as 4  cards with 16 AI per card) This will be deployed in different configurations at different customers so it needs to be flexable in how the channels are setup and acquired.  

 

The troubble I am having is detirmining how to syncronize all these tasks and orginizing all of the information.  Anybody have a good suggestion or example of how to acqurie lots of data and pass it around easly and have the whole thing be flexable to expansion?  

 

Also am I doing the correct thing with the callign the reentrant vi's, I have not used the new asyncornous call tool and the examples dont seem to apply.   

Download All
0 Kudos
Message 1 of 4
(2,450 Views)

Well, if I am understanding your intentions correctly on the reentrancy: you want to simultaneously "call and forget" multiple instances of the VI.  To do that, you would want to combine options 0x40 and 0x80 to get 0xC0.  Though keep in mind that this presumes that each instance will terminate itself, or otherwise is intended to keep running so long as the main application is running.

 

As for the data collection, I'm not sure I understand exactly what you are trying to do.  It appears from your code that you want several DAQ operations to each run completely independently.  The idea of using reentrancy suggests that you don't know ahead of time what or how many DAQ operations you have.  If that is not the case, you might be overcomplicating things.  You might instead just program the worst case scenarion and then optionally start certain tasks or not.  Regardless, it seems like you are trying to figure out how to retreive the data being generated by each of the instances.  If this is all on the RT system, you might use queues or notifiers set up beforehand by the launching VI; each instance gets its own queue/notifier.  What you use will likely depend on whether you want to capture all the data or are just concerned with the latest data point.  If trying to publish data accross a network, you might opt for psp variables or network streams, etc.

0 Kudos
Message 2 of 4
(2,442 Views)

Yes its is my inteneetion to have the all run independaly (albeit with a common timing source) and yes I do not know how many DAQ operations I will have.  

 

Thre are a number of channels that I will need to refer to by name at other places in the code.  Was not sure what would be the most efficent way to look at multiple readings from multiple tasks, is it more efficent to write to a queue/notifier 

 

The data is being saved and used locally on the RT and there is a pralell loop that streams it up to the host.  

0 Kudos
Message 3 of 4
(2,436 Views)

Queues and notifiers were just a suggestion of how you might share data between parallel processes; they have the advantage of being globally accessible by name and can be created dynamically.  The question is less one of efficiency and more about what you need done and with what type of time determinism and responsiveness.  Its a broad topic and there is no definitive right answer.  Are you going to be reading data continuously or in response to some event?  Do you need to do any filtering or processing of the data?  Is there more than one independent process that needs to recieve that data?  Do you need to capture all data or just the latest data? Does the recieving process need to create a response within a certain amount of time?  etc.. There are many ways to share data between processes on the local system.  Selection will depend on what sort of process synchronization you need and tolerance for data loss. 

0 Kudos
Message 4 of 4
(2,422 Views)