LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx, DO pulse only works on Port0/Line0

I cannot find 1 channel N samples that accepts a 1D array of booleans. When I click the polymorphic selector, none of the menu items says 1 channel N Samples. I found "Digital 1D U8 1 Chan NSamp" but that expects  U8, not booleans. There is a "Digital 1D Bool NChan 1Samp", but I don't think I want NChannels, right? 

0 Kudos
Message 11 of 15
(348 Views)

Got it!  Forgot to change my sample size when I changed to Boolean array.

2017-10-30  LabVIEW DO as Pulse boolean array.png

 

 

0 Kudos
Message 12 of 15
(339 Views)

Mmmmmm, not so sure you've *quite* got it yet.

 

First, you're right -- there isn't a 1D Boolean array version of DAQmx Write for 1 channel N samples.  All the N sample writes require either a digital waveform or the less desirable bitwise port format.   Sorry about that, it's been a while since I did hw-timed DO.

 

Dig into the digital waveform palette and you'll find a function to convert from your 1D Boolean array to a digital waveform.

 

Second, if you only define 2 samples for your repeating buffer, you may need to set up your task to do on-board regeneration.  It's possible DAQmx may do that by default when supported, but I'm not sure it will.  An alternative would be to define a much larger buffer of alternating T-F values to allow the driver to deliver data from PC to board in bigger chunks at a lower rate.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).



0 Kudos
Message 13 of 15
(331 Views)

Thanks for the extra background.  What I have shown  (1 Channel for all lines, Continuous sample, internal clock, 1D array of boolean with 1 and 0 and sample size of 2) works with my NI USB-6363 on any individual DO output pin. Works, meaning a continuous 50% duty cycle pulse is seen on my O-scope.  Since this is working, perhaps I will go back when I have more time and poke around with the waveform method.

0 Kudos
Message 14 of 15
(322 Views)

That's interesting, but also surprising in that you're showing a DAQmx Write for N channels 1 Sample.   I'm not sure why that works. It seems like you should need to specify N samples (and maybe also 1 channel).

 

After a closer look, I also see you've only defined 1 sample by feeding in a 1-element Boolean array constant.  I'm not sure why the task wouldn't either error (some DAQmx properties require a min quantity of 2, I thought data buffer might be one of them) or just repeat that same value indefinitely giving you a constant True state instead of pulsing.

 

But you see what you see, I'll believe it, just surprised.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).



0 Kudos
Message 15 of 15
(317 Views)