From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to cast ActiveX object using "to more specific class". Error "polymorphic terminal cannot accept this data type".

I have a generic class that needs to be converted to a more specific class. I tried using the "to more specific class" node resulting in the error "polymorphic terminal cannot accept this data type".So i tried typecasting it, which seemed fine during edit time, but caused LABVIEW to crash during runtime.

Thanks Alot for the help (in advance :D)

0 Kudos
Message 1 of 7
(2,190 Views)

I'm sorry to say but you won't get any help with your question.  You gave us nothing to work with.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 7
(2,169 Views)

Hello Aputman,

Sorry for that. I Will post the VI as soon as I can. Thanks for the feedback.

 

0 Kudos
Message 3 of 7
(2,165 Views)

Here is the code;I am trying to arrive at a more specific class.

0 Kudos
Message 4 of 7
(2,150 Views)

"To More Specific Class" doesn't work with Active-X references.  Just use "Type Cast"

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 7
(2,127 Views)

Thank you, but i have found the solution. It is to use the "variant to data" function like we would use "to specific class". The problem with type cast is that it crashes the entire VI. 

0 Kudos
Message 6 of 7
(2,124 Views)

Typecast is definitely not the right thing to use for a refnum. There is more work to do in the background than just reinterprating the refnum as another wire type. There needs to be a real call to the ActiveX Dispatch mechanisme to retrieve the new actual interface that corresponds to the desired object and a Typecast won't do that.

The To More Specific class VI would be the logical one to use but that was only introduced in LabVIEW 8 together with LabVIEW classes while ActiveX exists since LabVIEW 4 or so. Apparently nobody has dared to touch the ActiveX code in a way to move that functionality to the To More Generic Class.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 7
(2,116 Views)