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?
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.
Hi Jacob,
Edit: I placed wrong content here…
Recommendation:
@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.
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.
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.
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: