If you open your VI, right click on each reference and chose Show Control, you will see you have an empty cluster. The reference has no link to your typedefs.
If you delete the empty clusters then add your typedefs:
This will break the link on your Value properties:
so you just need to reselect Value from the property list:
and then your error box will look like:
As I said before, it should be noted that there is still a problem. In previoue verisons of LabVIEW, having an empty cluster in a control reference would generate a warning, not an error. There are situations where you would want to have a generic cluster reference.
Your code would run as you posted.
There is still a problem, as the errors are not correct.
Hmmm... So basically you are telling me that I was not using the proper way to create a reference to a cluster?
I tried disconnecting the control from the typedef before creating a reference and making a control out of it, and that gives exactly the same result. That is, the "Show Control" shortcut will show an empty cluster. I tried starting from scratch, creating a two boolean cluster and it failed again.
If I use a simple boolean or a simple chart, things look fine.
Does *this* qualify as a feature? Or where can I learn about this "non-feature"? I think I have created references to different types of controls like that since I have started using LV (or since references were introducde).
Actually my bad eyesight and another LabVIEW bug caused me an issue. What you did is fine. The star that is supposed to indicate the Data Type is included has moved behind the icon, so it is barely visible. When I saw it was missing (although it wasn't), I thought you had an issue.
I have never bothered to look at the controls because I have the star and know it's linked. But, it appears it doen't embed the typedef into the reference.
So, the compiler is still flagging errors that don't actually exist.
That problem where a reference control to a cluster shows an empty cluster seems to have been around since at least LV 8.5 (I just checked).
In LV 7.1, I cannot select "Show Control" (it's grayed out) so I dunno.
But I am pretty sure I have used such reference to cluster controls and they worked fine... I need to look into some of my code before I can confirm.
So, just to clarify, in the meantime, do we agree that:
1) creating a reference constant from a cluster (any, not even typedef), selecting this constant and using "Create Control" and switching back to the FP, choose "Show Control" in the contextual menu for the reference control shows an empty cluster? Valid through LV 8.5 (at least)
2) this does not make any sense?
The method you described is what I typically do. I would not have brought it up if the star indicating the data type was included was in front as it is supposed to be.
There appear to be no issues with what you did in your code. The issue is the LabVIEW compiler is not correctly identifying errors.
I saved everything back to 8.6 and the invalid error messages continue to show up in LV 2011, 2010, 2009, and 8.6,
I am concerned that the reference don't show the control. I can manually make the reference as I showed above. Going back to 8.6, this doesn't happen. I also don't seem to be able to get the Data Type included, although your saved VI continues to show it.
Everything will continue to work since the cluster takes a variant and you use typedefs everywhere else. I would think that it should show the control, but the step of creating the reference must cause the break of dropping the cluster typedef. As long as the include data type is included, you should be fine anyway because it will not allow a different cluster reference to be wired to ti.
OK, I see that you did not follow my diverging track 🙂
Here is what I am NOW talking about:
this is a LV 8.5 FP and its diagram:
Selecting "Cluster", I created a reference constant (shown below in the middle).
From this constant, I created a "Control": that's "Cluster 2" shown on the diagram below, and on the FP above, after I selected "Show Control".
The control IS NOT SHOWN. And it does not matter that the cluster is a typedef or not (it is not).
So either I don't understand what we have been talking all along (I don't care about the bogus error if NI decides that it does not matter, I really need to move on), or I don't understand what the purpose of "Show Control" in a reference control is supposed to do.
From what I see, it does not work with Clusters. Typedef or not. Is that fine? Fine! Is that not? Fine with me too.
As I said, I don't see anything wrong with what you did. I have done the same in the past. Clusters seems to revert down to an empty cluster and any data. I guess I have never bothered to look at the control in the reference before.
I do typically create it the way I outlined, which is to create a control reference and drag the control type into it, or manually select it from the right-click list if it is a primitive (i.e. boolean, string, etc.).
The (hidden) star is what is important - it indicates that the type of cluster is embedded in the reference. This means you cannot wire a different cluster type's reference. If the star is not there, you can wire any cluster to the reference.