11-08-2025 12:11 PM
Hello all,
I am writing with the following problem which i cannot wrap my head around at this moment.
I need to build a tool for a specific purpose and this tool will have a lot of clusters, we are talking about 100-150 clusters and each with 8-15 controls inside. They are of course separated in subpanels some are visible, some hidden. The nature of the project also makes it so that the clusters will often change: maybe new controls will be added or others will be changed in those clusters. This implies that ALL the clusters are Type Defs.
Each cluster will also update in different parts of the code. A part of the code will update some values, another part will update other values and all this happens asynchronously.
I noticed that using a DVR with In Place Element structure i can bypass the race condition that might appear due to different parts of the code working on the same cluster at the same time.
I am starting from scratch. The code below will have a race condition to it. I run it with highlight execution to "simulate" code delay. It is also using a Strict Reference of the cluster in question.
Here i am taking all the controls of the VI and getting only the one i need. This reference is a generic one thus i'm using variant to data and the Type Def of the cluster to be able to work on the data inside the cluster. This code also has race condition on it.
Using DVR and the Strict Reference of the cluster the code runs as expected, no race condition.
So the question is how can make this DVR-Strict Reference work by somehow connecting the Type Def of the cluster in between?
I need to use the Type Def because the clusters will change and i cannot recreate all the controls after the new reference of the cluster every time it changes.
Or any other solution is welcomed.
Also the clusters can also be changed the user at any given time at runtime while the cluster is being updated by the code. I need to prevent race condition for exactly this case when the user does and action on the cluster and the action gets reverted when a piece of code decides to update the cluster. The code that runs inside the In Place Structure should execute instantly.
Thank you.
11-08-2025 06:41 PM
This seems to be a bug, probably in "New Data Value Reference".
After changing the typedef (& applying changes), if you disconnect the wire from the cluster reference to the "New Data Value Reference", then rewire it, the changes will propagate forward. The best thing I can think of is to create a script that does that.
11-09-2025 08:42 AM
Connecting a typedef, or the UI cluster itself, to a DVR is irrelevant. The changes that take place inside the In Place Element will not affect the UI cluster.
11-12-2025 08:43 AM
Don't use front panel controls as data containers.