06-09-2011 09:11 AM
I have a simple VI here to read selected input values from a 9221 module on a cDAQ. The output values are formatted as a string. I'd like to output a second string that contains the names of the inputs I have selected so that I may write it to a file in a format looking like this:
#0, #3, #4, #7 <--- this is the new string
10, 12, 11, 18 <--- the string I already have
The top line shows the names of the selected inputs, and the bottom contains the measured values.
Thanks!
Solved! Go to Solution.
06-09-2011 09:31 AM
Do you only want to put the label on the first line and then just log data after that or do you want lables every time? Where are you going to get your lables from? Are you going to use names from a control, user imput names, chanel names etc...?
06-09-2011 10:41 AM
Yes, label only on the first line. I was thinking two separate strings(one for labels, one in a loop for data to keep being recorded)
Labels that I name would be best (just something like "input1", "input2", etc.). But this isnt too important as long as it's clear which channels the names correspond with.
06-09-2011 11:45 AM
Are you going to be taking data continuously or one time shot?
06-09-2011 01:39 PM
once at a time
06-10-2011 06:45 AM
Like this
06-10-2011 10:17 AM
I appreciate the help but this isn't quite what I'm looking for.. I need it to only show the labels of the items I have selected, not all of them. That's where I'm having problems. Thanks
06-13-2011 11:14 AM
It seems like you could create your own search function to look through the array of booleans and produce numbers that correspond to them.
See my attached code. I leveraged the power of the for loop, auto-indexing, and shift registers to complete this. I think it pretty closely matches your needs, although you may need to tweak it slightly. Also, you will have to change your DAQ channels in the assistant, as I changed it to something on my system to try the VI out.
06-13-2011 01:55 PM
This is perfect! Thank you very much