LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Default CTL from LV Class

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?

samkarlhuscocom_0-1729545394432.png

samkarlhuscocom_1-1729545406329.png

samkarlhuscocom_2-1729545501397.png

 

 

0 Kudos
Message 1 of 4
(277 Views)

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.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 4
(239 Views)

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. 

samkarlhuscocom_1-1729604058737.png

 

 

0 Kudos
Message 3 of 4
(215 Views)

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.

 

samkarlhuscocom_0-1729609615049.png

 

0 Kudos
Message 4 of 4
(202 Views)