LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx and Producer/Consumer architecture

Solved!
Go to solution

Hi,

 

I am trying to implement a simple code based on the producer/consumer architecture using DAQmx. So far, my code is quite simple and looks like the one below.

cap1.PNG

My questions are quite basic at the moment as I am trying to get a better understanding of the different coding techniques and the benefits each one has to offer. I was wondering, how can I implement that in a producer/consumer architecture so later I will be able to add additional processes in the consumer part?

 

Also in my saved tdms file, at the moment, I have only one column with my measurements. The optimal would be a 1st column to include the, a 2nd with the elapsed time while the rest of the columns will include my measurements depending on how many physical channels I have selected initially. By relative time I mean that the first cell will include the time of my computer's clock when I hit the "run" button and the last one the time when I hit the "stop". In-between the time values will depend on the rate and number of samples per channel.

 

I would appreciate any advice, hints or reference to examples I can study.

0 Kudos
Message 1 of 9
(5,640 Views)
Solution
Accepted by topic author MichailM

Here is an initial cut at the Producer/Consumer setup using DAQmx.

 

As far as writing the time channels, you will have to do that yourself.  But you can look at the Get Waveform Time Array VI in the Waveform palette to get the time values you want and then write them to the appropriate group and column.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 9
(5,596 Views)

Enable DAQmx Logging and presto.

 

Tim/\/\/\/\/...you know betterguns%202.gif


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 9
(5,591 Views)

@JÞB wrote:

Enable DAQmx Logging and presto.

 

Tim/\/\/\/\/...you know betterguns%202.gif


I almost mentioned that, but got distracted.  Besides, the OP wanted a time column, which the DAQmx Configure Logging does not do.  That might be worth making an Idea Exchange entry...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 9
(5,582 Views)

@crossrulz the "1D array of waveforms" which element is exaclty?

0 Kudos
Message 5 of 9
(5,557 Views)

@MichailM wrote:

@crossrulz the "1D array of waveforms" which element is exaclty?


I am not sure what you are asking here.  If you want to read multiple channels, you will get an array of waveforms (each item in the array will be a waveform for a single channel).  I just created a constant from that output after configuring the DAQmx Write.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 9
(5,544 Views)

hi Crossrulz,

how to create the waveform constant for data type? what if i want to use two waveforms?

thank you!

liang 

0 Kudos
Message 7 of 9
(4,857 Views)

@frogliang wrote:

hi Crossrulz,

how to create the waveform constant for data type? what if i want to use two waveforms?

thank you!

liang 


For a constant i usually r-click a fitting wire, in this case from the DAQ Read, and Create Constant. If you want to, make/read and array. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 9
(4,847 Views)

thanks a lot!

0 Kudos
Message 9 of 9
(4,834 Views)