LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with Producer consumer loop for triggered data acquisition

It's a Stanford Research Systems model DG 645 Digital delay generator

0 Kudos
Message 11 of 16
(958 Views)

We have an application involving 16-24 channels being sampled at 1KHz in LabVIEW RT and being streamed to the Host PC via Network Streams.  As the data come in, we display the data by averaging 50 points at a time (for an effective Chart Display rate of 20 Hz), and saving the "data we want to save".

 

How do we signal which data are to be saved and which are not?  The RT side, which is generating the data and "knows" if it is supposed to be saved, uses one of two mechanisms (we've used both mechanisms at different times).  One is to add a "Save Me" flag to the data, for example by adding an additional Flag channel that is "1" if this point is to be saved and "0" if not, with logic for stripping off this channel at the Host side and managing the opening and closing of data files, or using another communication channel to send "Start/Stop Saving" signals to the Host.

 

This puts all of the responsibility for synchronizing Start and Stop of saving with the acquisition of the data on one (Real-Time) system and creates a parallel "Consumer" loop in the Host that is told when to start and stop streaming the data.  Works like a charm.  All of the timing stays with the Remote Acquisition system (which has the accurate clock).  If it turns out that you want a single "Start" signal and want to save data for 0.1 seconds, then you can (at the Host end) translate the "time" criterion into a "Number of saved Points" criterion based on the desired Time-of-Saving and Sampling Rate.

 

Bob Schor

0 Kudos
Message 12 of 16
(952 Views)

Thank you for the idea, but i'm afraid i'm too inexperienced with programming and particularly labview to successfully implement it. Can you please explain a little more in detail how exactly to flag and deflag the input or put a read number of samples after the flag?

0 Kudos
Message 13 of 16
(948 Views)

Trying to teach someone LabVIEW through the Forums is a somewhat frustrating task.  Communication is slow, there are too many "cooks" making suggestions, and the "student" has to sort out all the competing suggestions.

 

Do you have someone locally who knows LabVIEW and can guide you through the LabVIEW Basics, including DAQmx, Queues, Producer/Consumer design, and proper LabVIEW coding practices (such as Data Flow, straight wires where possible, use of sub-VIs, logical organization of Block Diagrams, etc.)?

 

Bob Schor

0 Kudos
Message 14 of 16
(936 Views)

Hi Bob,

 

There are people with experience of LabVIEW but none that can help me with my particular application.

 

Rohit

0 Kudos
Message 15 of 16
(927 Views)

Hi Rohit,

 

You can find some getting started resources here:

 

"Introduction to LabVIEW"

http://www.ni.com/getting-started/labview-basics/

 

"Getting Started with NI-DAQmx: Main Page"

http://www.ni.com/product-documentation/5434/en/

 

You'll be able to get some good coding practices and "how-to" knowledge from these resources. After taking a look at these, if you still have some more specific questions we'll be able to help you out better.

0 Kudos
Message 16 of 16
(880 Views)