01-09-2025 10:24 AM
Hi,
I have a very simple question. I simplify my main problem to this. There is a while loop that constantly working. I want to see a and b similar always. How can I take data continiously out of loop.
Thank you.
01-09-2025 10:29 AM - edited 01-09-2025 10:32 AM
Start with the tutorial and learn about dataflow.
Your shift register makes no sense since you never use it's inner output. It just works as tunnel. If you want to see the value while the loop is running, the terminals belong inside the loop. Simple as that!
Since you wired a constant to the termination conditions, your VI cannot be stopped, just aborted. So fix that too. Once you can stop it, the terminals will show the last values after the loop completes.
01-10-2025 12:34 AM
Thank you for your response. As I mentioned, this is a simplified version of the VI for my main issue. I actually have a VI that reads an analog input using DAQmx inside a while loop. When the value exceeds 24, I want to close a relay using the NI-Switch VI. I believe the relay control should be outside the loop, as placing it inside causes issues with the relay behavior. Therefore, I thought that if I move the relay control outside the while loop, it would resolve the problem. I would appreciate any additional advice on this.
01-10-2025 03:02 AM
@afg484848 wrote:
I believe the relay control should be outside the loop, as placing it inside causes issues with the relay behavior. Therefore, I thought that if I move the relay control outside the while loop, it would resolve the problem. I would appreciate any additional advice on this.
Obviously you are not doing it right.
If you would describe the "issues" we get a clearer picture. Maybe attach the real code?
01-10-2025 05:59 AM - edited 01-10-2025 05:59 AM
A node (such as a structure, vi or indicator) can't execute until all inputs are available. B's input isn't available until after the loop stops ...