From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mini-Nugget Creating Typedef'd queue references

Solved!
Go to solution

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.

Message Edited by Ben on 11-11-2008 02:21 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 1 of 12
(7,731 Views)
Solution
Accepted by topic author Ben

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?

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 12
(7,693 Views)

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

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 12
(7,647 Views)
I can't check at the moment, but I'm pretty sure that in newer version you don't need to save the queue ref as a typedef. Once you drag the typedef into the queue ref every queue ref will be updated correctly when the typedef changes. I seem to remember that this didn't work in 7.x and did work in 8.x.

___________________
Try to take over the world!
Message 4 of 12
(7,618 Views)
That sounds about right.  I started doing this about LabVIEW 7.0 when I started using single-element queues for reference objects.  I always used the "create control, customize, save" method for creating the strict typedef reference, since it did not update correctly by itself in 7.0.  There were a lot of changes made in 8.0, some of which resulted in some fairly nasty crashes and hangs on type propagation (always modify your cluster with nothing else open in 8.0).  These were fixed in 8.2.  At this point, type propagation seemed to work OK.  However, I have been through a lot of versions of LabVIEW and have learned never to trust my memory on things like this.  Try it.  If it works, you are good Smiley Wink.
Message 5 of 12
(7,558 Views)

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).

 

Queue ref auto update

Message 6 of 12
(5,300 Views)

Eureka!

 

Auto-update reference is working for:

  • Queue
  • Notifier
  • Data Value Reference

one more screen shot:

Queue Notifier DVR Ref Auto update.png

Message 7 of 12
(5,285 Views)

Very nice. Smiley Happy

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
0 Kudos
Message 8 of 12
(5,273 Views)

Everything is typedef'd but I'm getting coercion. Ideas? 

 

queue refs coercion.png

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
Message 9 of 12
(5,253 Views)

I had same problem.

 

You have got Coercion Dots because your Queue references are type defs.

I have got only two typedefs:

  • queue data type
  • cluster with queue references

I didn't create type def of queue reference.

 

P.S.: Interesting reading: What's the Deal with Coercion Dots?

0 Kudos
Message 10 of 12
(5,249 Views)