11-11-2008 02:18 PM - edited 11-11-2008 02:21 PM
Transfering typedef'd data using queues used to be tedious if the typedef changed and the transfering queue reference is passed between VI's using controls. The tedious part was updating all of the controls for the queue ref since they would not be linked to the typedef of the data the queues transfers. This Nugget exaplains how to create a queue ref that is tied to a type definition.
1) Drop an obtain Queue
2) Create, drop, and wire a typedef of the data that will be transfered by the queue.
3) pop-up on obtain Que output and select "Create Control"
4) Find created control and pop-up to select Advanced >>> Customize
5) In control editor use the control palette >>> "Select a Control ..." and browse to the typedef from step #2
Note:
A) The typed must be dropped on the pink boxes
B) The marching ants around the queue ref control confirms you are dropping in the correct location.
6) Save the queue ref control as a type def.
If you look at your hiearchy you will see that the typedef'd queue ref is using the type def from step #2.
I hope this helps!
Ben
* This works in LV 8.6 but not in LV 7.1. I am not sure in which version the feature was introduced.
Solved! Go to Solution.
11-11-2008 04:24 PM
Hello Ben,
I tried to reproduce this in various (7.0, 7.1.1 and 8.6) versions. I get the same experience for all versions. I have the Hierachy window open to see what happens in each step.
I created a typedef'd cluster. I created a new VI and used this cluster for the obtain queue. I see that this cluster will be used by the VI. Creating the queue ref control and opening the control editor I see the control in the hierachy window. In the hierachy window I make a right click on the queue ref control and select Show all SubVIs and I see that the cluster typedef is used by the queue ref control. What change would happen adding step 5 which I have left out?
11-12-2008 07:32 AM
Good point Waldemar!
I double checked agin this morning and yes I was wrong about not being able to define the data structure passed via a queue in LV 7.1 !
So with your help I have learned that there is more than one way to get the queue reference linked to the the defining type definition.
Method 1:
Create the control from the Obtain Queue and save it as a type definition.
Method 2:
Drag the definition into the queue reference control and save as a type definition.
Thank you!
Ben
11-12-2008 10:14 AM
11-13-2008 08:36 AM
07-16-2013 05:56 AM
Ben and everybody else
Thank you for this article + discussion. This was something what I was looking for.
I need this when I have got more queues in one cluster which is distributed to all corners of application.
I am attaching screen shot of my "implementation" (LabVIEW 2012).
07-16-2013 08:23 AM
Eureka!
Auto-update reference is working for:
one more screen shot:
07-16-2013 08:50 AM
Very nice.
07-16-2013 10:07 AM
Everything is typedef'd but I'm getting coercion. Ideas?
07-16-2013 10:20 AM
I had same problem.
You have got Coercion Dots because your Queue references are type defs.
I have got only two typedefs:
I didn't create type def of queue reference.
P.S.: Interesting reading: What's the Deal with Coercion Dots?