Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to output all samples provided to AO 'Daqmx Base Write' box

I'm trying to simultaneously start two processes AI and AO. AO is what I'm having issues with. It should output more samples that buffer holds (150000 in my example). That's why I have 'Write' block in a loop. I was not able to write exactly as many samples as I provide to the 'Daqmx base write' box. Using the code attached, it outputs about 143000 samples and stops.

Would appreciate any advice.

 

I write only 5V or 0V output. Like a TTL signal. When I tried to use digital output, I was getting error 200452 at the start digital edge block. If there is a way around that? Please let me know.

 

Could not figure out how to use counter for my output either. Need to output square wave duty cycle of which changes continuously.

 

 

 

Any advice apreciated 


System: PCIe-6251 on an intel based MAC OS X, LabVIEW 2010 SP1 and I believe Daqmx Base 3.6

0 Kudos
Message 1 of 6
(4,070 Views)

Hello azotov,

 

For this application, you should be using a counter to output your pulse train.  Here is an example which can help you learn how to operate a counter task.

 

http://www.ni.com/example/29138/en/

 

You will need use the DAQmx Base Write VI to change the Duty cycle while your program runs.

 

I hope this helps.

 

Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 6
(4,047 Views)

Thomas,

 

Thanks for the reply. I was not able to follow your instructions. Counter output works fine at constant duty cycle, but I was not able to change duty cycle while the program runs. DAQmx Base Write has options AI and DO, but not counter. 2D U32 NChan NSamp, throws an error 200526, DAQmxBase Write does not match the type of channels in the task, what makes sense.
I tried to use Daqmx Channel Property Node CO.Pulse.DutyCycle, which I copied from another VI because I did not see a way to create it in Daqmx Base. That property node does not seem to function. Whatever value I passed to it did not change the duty cycle, and it reads as 0 whatever the duty cycle is

Please advise




0 Kudos
Message 3 of 6
(4,007 Views)

Hello,

 

I have done a little more research into having a varying duty cycle counter task, and it does not seem to be possible in DAQmx Base.

 

Instead of trying to call the Write VI in a loop, import all of the data into the Write VI at once.

 

Also I notices that you start your DAQmx Write Task twice.  Try to remove one of these VIs. 

 

I hope this helps.

 

Regards,

Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 4 of 6
(3,976 Views)

If I remove the first Write VI, I get 200290 error. Maybe it somehow reinitializes or clears the buffer output
I can't output all the samples at once. The buffer is 8192 samples, so I have to break up the samples array and output in smaller chunks.

Is there a way to trigger DO? As I mentioned in the initial post, I was getting error 200452 at the Digital Edge block trying to trigger DO. Maybe I need to replace the data acquisition board and get something that allows DO triggering? I have PCIe-6251 now


Thanks for advice 



0 Kudos
Message 5 of 6
(3,952 Views)

Hello azotov,

 

Triggering is not supported on the DO of the 6251. We should be able to get your code up and running utilizing the AO channel.

 

What happens if you remove the second Start VI?

 

Can you try to set the sampling mode to Finite? With continuous mode, the Is Task Done? VI will never be true.

 

Regards,

Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 6 of 6
(3,922 Views)