11-14-2024 10:17 AM
Hello everyone,
I'm using a VI in which I have an array of different types of refnums. I'd like to know if there's a way to get the most specific class “automatically”, i.e. without having to test the class name or ID and then condition it (see attached VI).
Thanks for your help!
11-14-2024 11:40 AM
Sorry, no.
11-14-2024 11:52 AM
If you have generic objects as an input, you cannot avoid casting them to a more specific class to use their specific properties.
You can kudo this (old) idea that aims to simplify want you want to do:
Regards,
Raphaël.
11-15-2024 05:55 PM
@raphschru wrote:
If you have generic objects as an input, you cannot avoid casting them to a more specific class to use their specific properties.
You can kudo this (old) idea that aims to simplify want you want to do:
Regards,
Raphaël.
You could create an XNode that is a case structure with that functionality.
11-15-2024 07:00 PM
@paul_a_cardinale wrote:
@raphschru wrote:
If you have generic objects as an input, you cannot avoid casting them to a more specific class to use their specific properties.
You can kudo this (old) idea that aims to simplify want you want to do:
Regards,
Raphaël.
You could create an XNode that is a case structure with that functionality.
On the off chance you're thinking of doing just that, maybe spend 10-15 minute listening to Darren Nattinger tell you not to use them first:
https://youtu.be/HKcEYkksW_o?t=589
(That is a link to his "LUDICROUS ways to Fix Broken LabVIEW Code" presentation from 2022 at the timestamp he starts talking about xnodes)
11-16-2024 10:12 AM
@Kyle97330 wrote:
@paul_a_cardinale wrote:
@raphschru wrote:
If you have generic objects as an input, you cannot avoid casting them to a more specific class to use their specific properties.
You can kudo this (old) idea that aims to simplify want you want to do:
Regards,
Raphaël.
You could create an XNode that is a case structure with that functionality.
On the off chance you're thinking of doing just that, maybe spend 10-15 minute listening to Darren Nattinger tell you not to use them first:
https://youtu.be/HKcEYkksW_o?t=589
(That is a link to his "LUDICROUS ways to Fix Broken LabVIEW Code" presentation from 2022 at the timestamp he starts talking about xnodes)
Well, I wasn't thinking of doing it. But also, at my age, someone's opinion about what I should and shouldn't do, doesn't carry much weight.
11-16-2024 11:43 AM - edited 11-16-2024 11:44 AM
Maybe I should invent a malleable XNode 🤪 (*.xnodem)!