LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find out which lines a user has assigned to a DAQmx task

Solved!
Go to solution

I have written an application in LabVIEW (2018) that allows the end user to plug in low-end USB DAQ device (USB-6008, USB-6001 etc) and select the two digital output lines that they want to connect to their equipment.

I can check that they have assigned two lines but I haven't found a way to determine which two.

 

I am outputting a byte at a time (Digital U8 1 Channel, 1 Sample) in which the bottom two bits carry the output data. I need to know which IO lines the user selected so that I can shift the data to the correct positions. I can find out all sorts of info on the device (how many digital outputs it has) etc, and the DAQmx Channel property tells me how many lines the user assigned to the task but not which ones.

 

Any clues?

 

Many thanks.

0 Kudos
Message 1 of 5
(2,537 Views)

There is a DAQmx Task property to get an array of channels in the task.


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 5
(2,531 Views)

Thanks crossrulz,

Using that as a starting point I extracted the physical channel names from the array and then converted to strings to parse the elements I need. It seems a bit long-winded and I don't know if it is a good approach. I couldn't find anything in the DAQmx palettes that got me any closer.

 

Working DAQmx user entry.PNG

 

 

 

 

Working DAQmx line selection.png

 

 

 

 

 

 Working DAQmx line selection front panel.png

 

 

 

 

 

 

Is this a good way to do it?

 

 

0 Kudos
Message 3 of 5
(2,511 Views)
Solution
Accepted by topic author magicbean

I would tweak what you did to make it a little more generic...


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 4 of 5
(2,501 Views)

@crossrulz wrote:

I would tweak what you did to make it a little more generic...


Ah - much better. I didn't realise that the unflatten from string function did that. 

Really helpful, thank you.

0 Kudos
Message 5 of 5
(2,492 Views)