Jump to content

Why are Control References Coerced in a Cluster?


Recommended Posts

I have been playing with the project templates in LabVIEW 2012 and have a question with regard to the coercion of control references in the Queued Message Handler.

In the Message Handling loop of the QMH a cluster is used to pass data, including control references for front panel controls. Attached is a screen shot showing the typedef constant that defines the cluster and a Bundle by Name function to include control reference data. Note there are no coercion dots on the Bundle by Name function. post-267-0-08402200-1349065363_thumb.png

Assuming I need control references in my application, I modify the cluster constant and control references for my own application. The difference I have noticed is that I now have coercion dots on the Bundle by Name function where I wire the new control references in. See the attached picture for an example and more details post-267-0-41542100-1349065360_thumb.png.

It would appear that the Control reference is a strict-typedef based on what I have tried, even when the control not even a typedef.

The questions that come to mind include:

  1. Why is the reference strict-typedef?
  2. Can I turn off the typedef, or do I need to?
  3. How did the developer create the QMH template without typedef?

Maybe I have read about this elsewhere, but I cannot find anything with Google. Does anyone have an explanation as to what is happening, or what I am missing? Thanks in advance.

Link to comment

The only way I was able to get the "strict" control references was to create a control reference control, right-click it and choose "Include Data Type", then create a constant from that strictly-typed control. In general, I only use "include data type" when I'm dealing with a control that can have different data types (like a listbox, which can be a scalar or an array), and I want to make sure that the VIs I have that may operate on the value of that control will only accept a strictly-typed reference.

I should also point out that the easiest way to get a control reference control of the correct type is to drop a Control Reference from Quick Drop/the palettes, then drag a control into the control reference to define its type. I'm pretty sure that's how I created the control references for the QMH template.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.