LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

variant type conversion to boolean

Solved!
Go to solution

Hello,

bad news. I had hoped that we were rid of this error but now is appears when we run it "for real" ; That means that the real data are fed to labview (coming from a PLC) and there it is again : error 91 , data type of variant not compatible etc... (look at probes 1 2 3) What's wrong this time??? We are approaching desperation... 😉

Thanks for help.

0 Kudos
Message 21 of 31
(1,520 Views)

That variant is actually showing a boolean.  Why are you getting two different results?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 22 of 31
(1,520 Views)

Honestly speaking I don't have a single clue why this is so. If we don't connect the "0" to the "type input"  we get the error too (even before we run it with the real data).

 

0 Kudos
Message 23 of 31
(1,514 Views)

Hello pgo1,

 

Are you using the same code and are you refering to the same OPC server or is it also physically a different OPC Server?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 24 of 31
(1,495 Views)

Hello Thierry,

it has always been the same OPC server indeed.

 

I will try a few things this morning and let you know.

0 Kudos
Message 25 of 31
(1,479 Views)

Here are screen captures of what we have tried this morning. I had hoped that one of those would have worked...but nada.

It is really strange that when you look at the probe values you see that the conversion is actually performed so why is it bugging with that error then??

Download All
0 Kudos
Message 26 of 31
(1,469 Views)

here are the rest of the screen captures

0 Kudos
Message 27 of 31
(1,468 Views)

and the last screen capture (one can only send 3 at a time apparently)

0 Kudos
Message 28 of 31
(1,467 Views)

That is strange that the raw data type keeps changing on you (between Boolean and Number).  Give this snippet a try.  I try to convert as a boolean.  If that fails, I convert as a numeric and compare to 0.

 

 

Also, for future reference, you can zip up all of your files and post the zip file (assuming it isn't too large).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 29 of 31
(1,444 Views)

Hello,

The raw data did change because we changed the source input (at the last capture). Although both are mentionned as boolean when you look at them from the OPC server quick client window (another strange thing).  Are you familiar with this OPC quick client window? Why does Labview see something different than what is mentionned there?

0 Kudos
Message 30 of 31
(1,431 Views)