04-03-2013 09:30 AM
Hello,
We also get a very annoying error of a boolean variable read from a PLC register that is automatically converted to a variant. And as such, when we wire a boolean indicator (led) to it it gives me the 91 error:"The data type of the variant is not compatible with the data type wired to the type input"
Some people have got the same problem but I don't understand a bit of the work around/solution 😉 !
The variable involved is the one at the bottom, "F3 BLOKKAGE SCHROEF 2 OK"
Thanks for help
Solved! Go to Solution.
04-03-2013 09:41 AM
I have to ask the stupid question. Are you sure it is really a boolean? Try putting a prob on the read variant and take a screen shot of it to show us what is really inside of the variant.
04-03-2013 09:46 AM
Yes we did put a probe and it is indeed boolean. When we create the default indicator at the output of the Variant to data conversion function we get also a display indicating the boolean value "FALSE" for the matter.
Thanks for your help.
04-04-2013 02:54 AM
Hello pgo1,
Can you try something for me?
Can you create a new true constant from the function palette and wire it to your type input (so that you are not depending on any autoresolving things?
Can you then create a new indicator at the output of the variant function (but also keep the old one in parallel)?
Please do take screenshots of the probing and also show where the probes were placed.
Thanks in advance!
PS: One thing I do not really like is that you're not doing any kind of error handling.
04-04-2013 10:04 AM
Hello Thierry,
here is the screen capture of what happens.
Indeed we should manage the errors. But we are beginners with labview and we still have to learn a lot ! 😉
04-04-2013 10:18 AM
So one of your many variant to data is making an error, but are you sure you are looking at the right one ?
And the prope picture is not really giving any meaning. Try making a indicator in the place where you have the probe, and then show us the frontpanel.
04-04-2013 10:25 AM
It looks like the data in the variant is actually a number of some sort. Try using an I32 and other representations to find the right data type. You can then use Not Equal to 0 to turn the number into a boolean.
04-04-2013 10:28 AM
Ok we will try that on Monday.
But we are sure of looking at the right Variant to data block because when the error message appears the block is highlighted.
04-04-2013 10:38 AM - edited 04-04-2013 10:38 AM
Also, you really should be supplying the data type when converting from a variant. There is an input on the top of the Variant to Data node for Type.
04-04-2013 01:56 PM
Hello Crossrulz,
That's also what I was trying to ask them to do regarding the booleans:
"create a new true constant from the function palette and wire it to your type input (so that you are not depending on any autoresolving things)?"
Normally this should give the same error.
Thank you for elaborating on this with relation to integers so that they will always try to wire the type input.