From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Finite waveform generation and acquisition in one VI

Hi,

 

I am Busy updating my old program, written in labview 6.1, so now i am doing it al in labview 2013 and with "for me" new DAQmx. I am experimenting with reading and writing signals at the same time. What my program eventually needs to do is the following:

 

1. Generate a finite number of samples with a sample frequency of 512Hz (this is a trial, i control the position of a laser beam) i have several trials...

2. Aquire the data with a sample rate of 512Hz.

 

Now the thing is my trial could last up to 3 minutes of samples, so that would be: 180 x 512 samples = 92K samples... Is there a way to cut that and deliver lets say one second (512 sample) every time? With other words can i put a while loop around the "DAQmx write" and feed it with finite samples... or does my clock only counts untill the namber of samples per channel...?

 

The snippets show a simple VI of generating and aquiring samples.

 

example.png

 

Best regards,

Thijs

 

 

0 Kudos
Message 1 of 3
(3,353 Views)

Hello Thijs,

 

The VI you created works like that you first write all of data (in this case 8192 samples) into your buffer and then it will start the generation of the data on your output with an output rate of 512 Hz.

 

So if I understood you correctly you want to deliver every second 512 samples to your Writing VI and that should be updated then on the Output. If I missunderstood there something

please clarify that.

 

But this is not possible with the Finite Sample mode, because you have to write all data into the buffer before starting the generation. If you want to do this like that you have to use continious sample mode. But I saw u already got some help for this issues that belongs to that in an other forum thread.

 

One more tip: if you use finite sample mode just use the Daqmx Wait until done.vi instead of the loop. It basically does the same.

 

Just let me know if that matches your question or if you need other information.

 

kind regards,

 

Markus

0 Kudos
Message 2 of 3
(3,318 Views)

Hi,

 

I need to use the regeneration mode and set it to "Do Not Allow Regeneration" and then i can put a DAQmx write vi in a while loop, or a for loop. So that's how i am going to do it...

 

Regards,

Thijs

 

0 Kudos
Message 3 of 3
(3,308 Views)