LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform NI_ChannelName as string

When using the GetWaveformAttributes vi specifying "NI_ChannelName", the returned value is a variant.  Thus, it can't be passed to routines that expect a string channel name.
 
I can't find a way to convert the Variant to String.
 
There must be a way to get the channel name as a text string!
0 Kudos
Message 1 of 10
(3,664 Views)
Varient to data will do the trick.  Search for it from the functions palette.  (It is located in several places in LabVIEW 7.x and in a totally different one in LabVIEW 8.0).  I think you can also use format into string. 

Hope that this helps,
Bob Young

Message 2 of 10
(3,661 Views)
Thanks, that did it.  I had tried several other methods but all gave junk.  I didn't find this because I looked in String functions and Waveform functions.... not in Clusters!
0 Kudos
Message 3 of 10
(3,657 Views)

I'm having the same issue, but when I wire a string to variant type, I get an error "datatype of the variant is not compatible with the data type wired to the type input"

 

I'm trying to extract the waveform name from the attributes and having little luck, any suggestions?

0 Kudos
Message 4 of 10
(3,232 Views)

Hi Dude,

 

have you tried to wire an (empty) string to the type ("default value") input of GetWaveformAttribute?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 10
(3,224 Views)

I figured it out, just have to do it as a two step process, like this.

 

Thanks.

0 Kudos
Message 6 of 10
(3,219 Views)

Hi dude,

 

using my comment it would be a one step process…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 10
(3,207 Views)

can you provide an example?

0 Kudos
Message 8 of 10
(3,203 Views)

Hi dude,

 

one step:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 10
(3,180 Views)

Could have sworn I tried that and was getting error?!?!?! Anywho, thanks for the suggestion.

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