02-01-2019 05:09 AM
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.
Solved! Go to Solution.
02-01-2019 05:31 AM - edited 02-01-2019 05:31 AM
There is a DAQmx Task property to get an array of channels in the task.
02-01-2019 06:39 AM - edited 02-01-2019 06:45 AM
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.
Is this a good way to do it?
02-01-2019 07:16 AM - edited 02-01-2019 07:17 AM
I would tweak what you did to make it a little more generic...
02-01-2019 07:54 AM
@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.