03-13-2025 06:03 PM
I'm programing a subvi that needs to asynchronously pull the values of some controls from its parent vi. I did it like this
The issue is that only the string gets updated as the parent vi runs, the double never updates dt all. This is despite the fact that they are connected to the same source
It isn't that double controls don't work at all. another control I'm referencing has its value updated just fine. But this wire is acting differently.
BTW, referencing the source control of the wire has the same issues, that's why I'm making test controls to begin with.
Does anyone have any idea why this might be the case?
03-13-2025 06:25 PM - edited 03-13-2025 06:28 PM
Just store all the control refs of interest in a typedef'd cluster and send them to the subVI like that. If you want to present clean code you can always stick them in a global variable as one of the first things you do in the top level VI to be recalled inside the subVI. I mean, you'll take a small performance hit, but compared to using property nodes, it should be unnoticeable.
03-14-2025 01:45 AM - edited 03-14-2025 01:50 AM
Hi Jacob,
Edit: I placed wrong content here…
Recommendation:
03-14-2025 04:37 AM
@GerdW wrote:
Hi Jacob,
Edit: I placed wrong content here…
Recommendation:
- The purpose of FP elements is to display (or input) data.
- You should not mis-use them to transfer data between VIs.
- Use other ways like channels, queues, notifier, globals, FGVs, events, …
Is that what they were trying to do? It's such taboo for me that it didn't even occur to me.
03-14-2025 05:02 AM
Your original control is either a Numeric or a String. One of your reference typecasts will fail, as you can verify viewing their error out values.
03-14-2025 09:43 AM
If it's a sub-vi, just send in the value via wire (connect the control to the connector pane)
If it's supposed to run in parallell, send/read it through any of the following; user event, queue, notification, FGV, Global.
03-14-2025 11:39 AM
It's because a string is a string, but a numeric value could be an integer, a double, etc. It's pretty unusual what you're doing (because you will get errors in an attempt to go to a more specific class), but anyway, you need strict refs, then it will work as you wanted: