LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Refnum / Property Node to a cluster or an array of strings

Hi I'm wiring a new app, and I really need to make it flexible (the needs of my customers are changing a lot). Basically I'm using XNET and and I'm putting information into different trees. The thing is that if I want to add another column related to a new property I need to rewrite a lot VIs. Is there any solution to have more generic solution?

 

See the attachment, cause I'm not really that it makes sense for a lot of people here.

0 Kudos
Message 1 of 10
(5,490 Views)

Hi Nelval,

 

without being able to open your VI I would like to suggest a typedefined cluster in an array…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(5,456 Views)

Well I think my post has been misunderstood. I downgraded the version required for opening the attachment (2010). 

 

Hope this can help to better understand what I want to achieve.

0 Kudos
Message 3 of 10
(5,441 Views)

Hi Nelval,

 

LabVIEW is strictly datatyped, so you have to know the datatype of a wire before you can run your VI.

 

Does that answer your question?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(5,435 Views)

I know what strictly datatyped means, however I thought they were some tricks to have the property values from a refnum, afaik there is still the Cast function in some cases, the type could also be added to this imaginary function to extract the property I want regarding its name... just like Generic in C# / Java (although not really true for Java)...

 

Well I'm afraid there is nothing I can do for that... that sad, it would avoid me to refactor a lot wires... Sometimes I think it's pretty limited out of the Prototype Application Design =/

 

That being said,  I'm quite surprised that there is not such function.

 

 

0 Kudos
Message 5 of 10
(5,430 Views)

Maybe your expectations from a programming language are too high.  Sometimes you just have to do the legwork.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 10
(5,422 Views)

It sounds like maybe you're using the wrong architecture. Trying to pass several related values (value, min, max) through a reference to a front panel control is not a good solution. Can you explain in more detail what you're actually trying to do?

 

You might consider an OOP solution, where you pass objects around. Then you can have a method in the object that returns a list of all the available properties, and a way to retrieve them however you want. As the data expands you can simply add a new object an override a few methods.

0 Kudos
Message 7 of 10
(5,406 Views)

I was more thinking about a language feature, of course I could go with a OOP but it does not solve this bottom line issue.

 

In C# I could use reflection to inspect the property/ies and to get the value of a certain property accordingly to its name, or just by going through a collection, whether it's refering to Type or a Instance.

 

I think once again it has been misunderstood... I will provide another example to highlight even more my problem.

0 Kudos
Message 8 of 10
(5,387 Views)

Here is another sample...

 

I think that in this situation it's pretty obvious that if I want to change the property that I want to display it requires to hardcode a lot of things for example I cannot make a list of booleans and select which column to display. Or I need to provide to save first all the columns and use conditions tricks but that means it requires to check alllllll the properties in a very first place =/

0 Kudos
Message 9 of 10
(5,373 Views)

Hi Nelval,

 

again I would appreciate your VI in LV2011…

 

When you want to read properties of FP elements you need to program all those read operations!

That's it. Point.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(5,369 Views)