10-21-2024 04:21 PM
Hello All,
I have some legacy code I am trying to improve and want to make this variant to data read inside my VI by more dynamically generated. Right now I have to create a constant of the default class and then make that the type. I would like to use my class to create a "default copy" of the Test Sequence.ctl cluster so I can pass that into my variant to data. How should I go about this?
10-21-2024 09:53 PM
Actually, you cannot statically type a wire dynamically. To be clear, the type of wire output from the Variant to Data must be determinable at edit time and not at run-time. To make this work for multiple classes, you need to type cast them to a generic type so that irrespective of the actual class data that is converted from variant is still compatible with the more generic class type wire that was implemented during edit time.
10-22-2024 08:45 AM
Santhosh,
Thank you for the reply. Your solution to cast all data to something like a string and then read the strings could work. However, I am interested to utilize the power of LVOOP. I am not entirely sure if screenshot below will work, but the data coming in is the same type/cluster as the class.
10-22-2024 10:09 AM
This ended up being my solution, it's an alright solution. Still breaks if I change the other parts of that aren't a type def. Could the solution be to place everything in a typedef. If so what is the point of a class? Wish there was a way to access/read the the class private cluster then just output that.