04-15-2008 07:31 AM
04-15-2008 09:07 AM - edited 04-15-2008 09:08 AM

04-15-2008 11:47 PM
04-16-2008 12:25 AM
04-16-2008 01:46 AM
Ravens Fan wrote:
Smercurio, I think his problem is that he is converting different types of data to a variant before passing it into the shared variable. That one time it could be string, another time something else.Mika, in the instance you are getting this error, what kind of data are you putting into the shared variable? I'm guessing it is NOT a string in that instance. I would recommend describing your application a little bit more and why you have the need to pass different data types through the same shared variable. There may be a better way to accomplish what you are trying to do.You might need to have another, related shared variable where you pass an enum describing each of your possible datatypes. Use that as a selector to a case structure where each case has a different data type going into the variant to data function. You may even be able to do this using some builtin LabVIEW functions that can inspect the datatype of the variant. I want to say there were nuggets on this, but I had a hard time finding one that describes exactly what I am thinking of. But even if all of this is what you want to do, what do you do with the data once you have it. In a Boolean case you'd have to connect it to a boolean wire, string case a string wire, numeric a numer wire. They would have have to different destinations anyway.Maybe I'm reading your original message wrong and you don't have a single shared variable that is a variant type, but numerous shared variables.I would recommend describing your application a little bit more and why you have the need to pass different data types through the same shared variable. There may be a better way to accomplish what you are trying to do.
04-16-2008 02:49 AM
04-16-2008 04:37 AM
OK.Problem solved.I used reference files keys values to define what type variables are going to be(d=double,b=boolean,s=string). I didn't notice it earlier but I don't need reference files keyvalues anywhere else. Simple as that. 😉
Mika
04-16-2008 08:16 AM
04-16-2008 10:10 AM
04-16-2008 10:51 AM