02-20-2025 05:40 AM
Im changing within different excel files for different wind speed MPPT, and i have use case structure to choose between different files with slider , how im gonna use FGV for array, i tried from other forums fgv for array (https://forums.ni.com/t5/LabVIEW/Example-on-how-to-set-an-array-as-a-Global-Variable-LV2/td-p/86531) but when i tried to change excel file from wind speed 5 to 6m/s inside the while , i didn't got change in array outside the while loop.
Thankyou
Solved! Go to Solution.
02-20-2025 06:10 AM
From a data flow point of view, your second while loop will not execute until the first one is not stopped. Try to remove the connection between both and run them in parallel. It's a good idea to add a small Wait (ms) into both.
And please attach the whole code instead of a screenshot.
02-20-2025 08:29 AM
What Andrey meant to say: From a data flow point of view, your second while loop will not execute until the first one is not stopped.
The "wire" coming out of the first loop doesn't happen until the loop finishes. The (same) wire going into the second loop doesn't happen until there is data in the wire, and the second loop doesn't run until all its inputs have data. I call these "The Second Law of Data Flow" and "The First Law of Data Flow".
Bob Schor
02-23-2025 10:46 PM - edited 02-23-2025 11:00 PM
tried to remove while loop connection between them, still doesn't work
also I'm switching between different csv files, so i need constantly it to updates, i need changing values of array continuously for NI VISA write process, now continuous serial communication already has one overall while loop, but i have observe if there lots of while loop inside while loop some kinda race condition or sometimes inner loops just doesn't work, in my case arrays doesn't get updated,also im sharing csv files, which has order column wise as Volt,Power,Current, number order on the csv files are "different wind speeds"
02-23-2025 11:05 PM
another dummy file i made without ni-visa to test for changing arrays, and tried to implement same logic as before here, i tried to make an overall while for whole vi
02-23-2025 11:48 PM
I think you mixing some different thing together.
Attached a very basic example of the FG.
The FG Itself is just trivial getter and setter:
Two loops running parallel:
This is how it works:
02-24-2025 01:04 AM
i have worked with FGV before but for decimals , never tried with arrays, i need continuous changing array as wind speed changes(slider), so fgv needs to update whole array instead of elements of array
Thankyou for the solution
03-04-2025 01:06 AM - edited 03-04-2025 01:28 AM
thankyou for the solution
is it even applicable for more than one dimension array?
also how can i add while loop inside the fgv itself so i dont to add whiles in other VIs to constantly update, something like while/for loops and shift registers
03-04-2025 03:14 AM
@shashankshetty wrote:
thankyou for the solution
is it even applicable for more than one dimension array?
also how can i add while loop inside the fgv itself so i dont to add whiles in other VIs to constantly update, something like while/for loops and shift registers
Yes you can have multi dimentional FGVs. Then i'd expand it to an Action Engine (AE) and add functions for adding and removing a line or column and such.
Your second sentence makes no sense, the FGV is a data container, it has nothing to do with while loops in other VIs and are often used in loops. Or are you referring to the standard while loop in a FGV? It's just a 1 loop structure to hold the Shift register (which holds the data), the Feedback loop does the same thing, but when you add functionality it might be easier to construct it with a loop.