i am using a Vi to read the Resistance of an Ohmmeter. This works fine, also i can let it run continously, to get the values.
However, now I want to use this VI in another one. For this purpose, i use a while loop, and place the beforementioned VI inside, connect it to a numeric indicator. When i start, the first vale is shown in the indictor, but no new values are sent to it...?
I have no idea why or whats going on.
Thank you for our help,
Solved! Go to Solution.
You don't understand data flow.
Your calling VI calls the subVI and waits for it to finish. You have a while loop running continuously so it doesn't finish. As a result, the calling VI is stuck waiting.
so there is a problem in YOUR VI and you need to debug YOUR VI on your own.
Or you might just attach YOUR VI here…
Thanks for your answers.
But i dont see whats wrong. When i run the Vi which i call by itself, everything works fine - no error, no infinite while loop, all good...
So i Call the Vi Read Omega, i get the first value. Then in the second run everything stops working.
Why? The ReadOmega Vi works fine when i just let it run continously by itself - so i guess it does finish?
I just tested gain the step by step run - There is no loop and the VI does finish! I just that only the first value gets send to the indicator? The i can go on further step by step but the value is not updated anymore?
I also added an indicator to the loop variable i - and it does increase! No waiting for the Vi to finish, but why is the new value not passed to the indicator?
Presumably the Read Omega vi is returning the same value over and over, but without being able to see what's happening inside of it there's no way for us to know. Can you post the whole project?
Even if it doesnt work, the first loop is cancelled when i>10, the second loop stop if a \n is read (the std. output after each send). So no infinite loop. Anyway that is not the problem as said above. But what could be the problem here?
Have you tried to debug your Vi will it is running?
What is the string that is return from the instrument?
(And why are you not using VISA in the correct way? Use the termination character option on the VISA)
the second loop stop if a \n is read (the std. output after each send). So no infinite loop.
And what if you are not getting any data? Oh, you will have an infinite loop! Anyways, your two loops there could be done with just two VISA Reads with the Termination Character enabled (default when using the VISA Configure Serial Port). You just tell the VISA Read to read more bytes than you expect in a message and it will do the rest. Furthermore, you will get a timeout error if data is not coming in.