LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI cDAQ - select signals

Solved!
Go to solution

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!

0 Kudos
Message 1 of 9
(3,218 Views)

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...?

Tim
GHSP
0 Kudos
Message 2 of 9
(3,213 Views)

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.

0 Kudos
Message 3 of 9
(3,208 Views)

Are you going to be taking data continuously or one time shot?

Tim
GHSP
0 Kudos
Message 4 of 9
(3,203 Views)

once at a time

0 Kudos
Message 5 of 9
(3,197 Views)

 

Like this

Tim
GHSP
0 Kudos
Message 6 of 9
(3,188 Views)

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

0 Kudos
Message 7 of 9
(3,181 Views)
Solution
Accepted by topic author ENGRLAB

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.

 

 

Paul Davidson
National Instruments
Product Owner - ni.com Chat
0 Kudos
Message 8 of 9
(3,152 Views)

This is perfect! Thank you very much

0 Kudos
Message 9 of 9
(3,143 Views)