10-27-2011 02:52 AM
Hello all
I am trying to use a config file to store my settings data. At the moment this consists of COM port settings and paths. I thought that it would be best to return a variant from my VI, but my code below gives this runtime error:
LabVIEW: The data type of the variant is not compatible with the data type wired to the type input.
So this means that Labview doesn't handle the Variant > Path type conversion. I can go back to sending out string data and converting this to a number or path in the calling code, but is there a better way to do this?
Thanks for any suggestions (I am a newbie)
Ray
Solved! Go to Solution.
10-27-2011 06:12 AM
It should work just fine. When you get it from your config file, are you reading it as a string? If so, that is your problem. The item has to be a path before converting it to the variant. If your variant is based on a string, you'll have to convert it to a string, then a path.
10-27-2011 06:17 AM
Thanks Matthew - the problem was as you stated - I was converting String > Variant > Path.