07-03-2019 06:42 AM
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)
07-03-2019 08:21 AM
I'm sorry to say but you won't get any help with your question. You gave us nothing to work with.
07-03-2019 08:30 AM
Hello Aputman,
Sorry for that. I Will post the VI as soon as I can. Thanks for the feedback.
07-04-2019 05:32 AM
Here is the code;I am trying to arrive at a more specific class.
07-05-2019 08:06 AM
"To More Specific Class" doesn't work with Active-X references. Just use "Type Cast"
07-05-2019 08:17 AM
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.
07-05-2019 08:41 AM
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.