ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
09-06-2022 12:34 PM
Hi,
I'm pretty new to LabVIEW and encountering this problem. I am hoping to get some help with the problem I've been having.
Objective: Transfer data (Boolean and numerical) from a sub vi to the main vi.
Problem: The sub vi has a for loop and the main vi has a while loop, and for some unknown reason the data off the sub vi is not transferring to the main VI. There are inputs for the sub VI, which are controlled from the main VI, and during runtime those inputs does get updated real-time in the sub VI too. During runtime I've noticed the sub VI works fine and outputs the corresponding signals, but I need those signals into the main VI. I've found some similar problem for some users and i went through the solutions too, but still doesn't seem to work in my case.
I am attaching the VI code and snips (Main/Sub) of the code. The Vi works for rest of the functions except for this instance. The VI is still a work under progress, so please point out any other suggestions or recommendations regarding it.
Thanks
- themadgreek
09-06-2022 12:49 PM - edited 09-06-2022 12:50 PM
Hi greek,
@themadgreek wrote:
for some unknown reason the data off the sub vi is not transferring to the main VI.
There is a very known reason: THINK DATAFLOW!
Dataflow dictates which part of code is executed:
Problem analysis:
Suggestion:
09-08-2022 04:21 AM
Hi Themadgreek,
you might consider use Functional Global Variable(FGV) to transfer data between different loops, even different VIs.
There are of course other solutions, but the FGV is the most easy way to solve your issue.
https://learn-cf.ni.com/teach/riodevguide/code/rt_functional-global-variable.html
Regards,
FrankenChino