09-21-2012 04:51 PM
I have problem to store and transfer a config data refnum value.
The value shown using a probe seam to be OK, but it is not accepted as soon as a continuous run is used.
The attached file shows what I have tried.
How can config data refnum value be handled?
Solved! Go to Solution.
09-21-2012 06:31 PM
Do not use Run Continuously. It's designed for limited debugging purposes, not for running your code normally. If you need your code to continue running, put it in a while loop (with some sort of loop timer such as the Wait (ms) function, so that it doesn't run as fast as possible and consume all your CPU time). Using "Run Continuously" is like hitting the Run button over and over, and some things reset each time you hit the run button. For example, whenever a top-level VI terminates, any references that it opened - queues, file references, TCP connections, etc - are closed and become invalid. That's what you're seeing - every time the VI finishes, it closes the file, so even though the refnum still contains a value, that value is no longer a valid reference to a file. Use a while loop instead to keep your code running and it will do what you want.