LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Semaphores in a Cluster don't show their name in Unbundles

Solved!
Go to solution

I have a couple semaphores that I am routing through my program in a cluster, however, unbundle by name just gives me a generic list of "semaphore" and I have to memorize the order in which they were placed into the cluster to access them.   I can use the Get Semaphore Status.vi, and read their names elsewhere. 

 

What's the best practice for handling this? 

0 Kudos
Message 1 of 4
(2,704 Views)
Solution
Accepted by topic author Chris_Cox

You should make a typedef cluster with descriptive names for the semaphore items. Then use bundle by name to bundle them into the cluster, and they will have descriptive names when you unbundle.

 

 unbundle.png

Message 2 of 4
(2,696 Views)

Also, you don't need to give semaphores a name if you are passing around the reference wire to it. You only need to name it if you want to access it somewhere else without passing the wire. If you don't intend to obtain a second reference by name to that semaphore, it is probably better practice to not name it because then you can be sure that only the places that have the wire have access to it and nowhere unauthorized.

Message 3 of 4
(2,692 Views)

Thanks HopeH!

 

Makes sense, I was only trying to give them a name so I could get the name to show in the cluster, but that obviously didn't work. 

0 Kudos
Message 4 of 4
(2,683 Views)