08-28-2018 07:21 AM
hello everyone
i have a lot of constants inside a constant cluster
i have tried this :
https://forums.ni.com/t5/LabVIEW/Sort-elements-in-a-cluster-in-alphabetic-order/td-p/3649743
but the problem i couldn't find out where to get this cyan, and if it works the problem i have every time to convert the constant cluster to control to convert the names then back to constant, anyway when it works also good
thanks very much
08-28-2018 07:30 AM - edited 08-28-2018 07:35 AM
Hi MJDGH,
to sort cluster elements alphabetically by their label they need a label!
To create a cluster with nice labels I recommend to create a typedefinition of your cluster (with all elements having a descriptive label).
Then just drop that typedef onto your block diagram to create a cluster constant with elements having nice labels.
What is all this good for? Why do you need to sort cluster elements programmatically?
08-28-2018 07:32 AM
you need to create type-def cluster to make it work. right click on the cluster control, select make type-def and save the control. Use the saved control in the solution you found on the other thread.
08-28-2018 07:37 AM
sure i have a label for each variable inside the cluster but the problem is i am using these names in many places in the program
its not possible now to add more than one cluster and i have a lot of variables i want to access them faster when they are by alphabetical order.
if i made the constant as type def then how to order these inside it ?
08-28-2018 07:41 AM
Hi MJDGH,
when you want to access "variables" by their name I recommend to use VariantAttributes (inside a FGV)!
08-28-2018 07:46 AM
can someone tell me how to get this element inside the link where to get this vi !
08-28-2018 08:00 AM
08-28-2018 08:06 AM
Hi MJDGH,
You can find the element in 'vi script' that are not visible by default. To activate it you click on : Tools, options, Vi server, Vi scripts and you check 'Show function, property ...'. You should now find it in your LabVIEW.
Or can simply use the fact that your link show a snippet, which means that you can drag it in your code to directly get the whole code shown in the picture.
08-28-2018 08:07 AM - edited 08-28-2018 08:08 AM
hi mjdgh
are talking about the subvi in your link, that seems like third party toolkit. you can also create yourself one, i have attached a sample .
edit:attachment
08-28-2018 09:14 AM
Hello
can someone please explain how to set the VI in edit mode
because i got this error:
LabVIEW: (Hex 0x431) This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode.
Thanks