07-17-2017 07:19 AM
Hi, i have a problem with property node. I want to take all properties like Value, Visible and write to an array. Can i do something like that ?
Solved! Go to Solution.
07-17-2017 07:33 AM - edited 07-17-2017 07:40 AM
Hi Kamilnd,
Can i do something like that ?
Yes.
You need to read all properties and store them in an array.
Maybe you need to convert some values to strings before building that array.
Maybe you could use a cluster instead of an array…
07-17-2017 07:37 AM - edited 07-17-2017 07:41 AM
No. See the definition of arrays. The elements of an array must be the same data type! So for example, you cannot store the "Visible?" and "Value" properties of a numeric control in the same array. The first property is a Boolean type, the second is a Double numeric data type.
But what you can do is to create a type defined cluster to store those values which you want:
Edit: or as GerdW suggested, you could "Flatten to String" all the properties, then store it in an array. But a cluster is much easier to handle, using the Bundle/unbundle by names. Using arrays you can make mistakes more easy, and you need to keep track which property you store at which index of the array...
07-17-2017 08:16 AM
Sorry i asked a wrong question. I want to get all names of property and write to an array, how can i do that?
07-17-2017 08:23 AM - edited 07-17-2017 08:31 AM
Here is the list of all properties of a generic control:
http://zone.ni.com/reference/en-XX/help/371361H-01/lvprop/control_p/
Edit: also see this: http://digital.ni.com/public.nsf/allkb/C53188E560BC57C086257161005E1E37
07-17-2017 08:44 AM
yeah, i know about that, but i want to do this dynamically not static.
07-17-2017 08:57 AM
Hi Kamilnd,
i know about that, but i want to do this dynamically not static.
Then also read the properties for specific controls from the LabVIEW help.
When there is a reference to some control in your VI you need to determine its specific type, then get the corresponding properties from the list in the LabVIEW help.
Why do you need to determine property names of a control at runtime???
07-17-2017 09:40 AM
07-19-2017 06:58 PM
I've done this before when I needed to get a list of properties a given .NET node had. Here's basically what I did:
08-29-2017 11:53 AM
Can someone tell me what function is this? thanks