Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital input and output with "1 Sample (On Demand)" issue

Hello Dear NI-users,

 

I am developing a labview interface for controlling a brushless dc motor. The motor drive needs a

 

--"enable" signal for the initialization: a digital high/low output and

--"command signal" for the position: a analog output

 

Both signals should be generated in real time in labview, via the "1-Single on demand" option with the DAQ-Assistant, running in a while-loop.

The problem is, that labview treats the signals to/from the "DAQ-Assistant" as arrays, therefore I need to generate an array with just one element, see picture.

 

Is there a more elegant solution to this?

 

 

 



Download All
0 Kudos
Message 1 of 4
(3,346 Views)

Just use a single control and then Build Array reduced to 1 input.


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 2 of 4
(3,318 Views)

Hi,

 

I agree with crossrulz regarding the build array function, ...

screenshot.PNG

... but if you want to do 'real-time' control you better have HW that supports Hardware-Timed Single Point Sampling.

 

Does My DAQ Device Support Hardware-Timed Single Point Sampling Mode? - National Instruments
http://digital.ni.com/public.nsf/allkb/B4E831774F29FB038625754C0081C050

Or at least do not use the DAQ Assistant since that probably initializes and deinitializes the DAQmx task every time, so probably use the lower-level DAQmx API functions as explained in the DAQmx examples.

 

Best regards,

Christoph

Staff Applications Engineer
National Instruments
Certified LabVIEW Developer (CLD), Certified LabVIEW Embedded Systems Developer (CLED)


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved
0 Kudos
Message 3 of 4
(3,310 Views)

Thanks for the reply.

I resorted in using the traditional DAQmx blocks. This way I can write/read my data much more convenient without having to compose/decompose arrays 🙂



0 Kudos
Message 4 of 4
(3,285 Views)