02-03-2012 09:07 PM
Hello,
This is the first program that I have attempted to write alone....and I am stuck. I am trying to acquire data from a scope. I want the vi to only load the scope setup the first time the code is executed. Once the setup has been loaded I just want the vi to reinitialize the scope in order to acquire more data. I have tried first call, case structures, ...everything I can think of, but when I continuously run the vi, it still loops and reloads the setup each time. I have attached a picture of the vi code and outlined the area of code in question. The outlined case structure is programmed to initialize the scope to open communications, then clear any existing data, then recall a specific scope setup on true. On false, I only want this setting of code to initialize communications with the scope again without recalling the setup. Can a professional please explain how I am supposed to accomplish this. Thank you
Solved! Go to Solution.
02-03-2012 09:18 PM - edited 02-03-2012 09:18 PM
If you use CONTINUOUSLY RUN to keep something running, you are in effect pushing the RUN button every time it stops, so the FIRST RUN function will return TRUE every time.
There are ways to do exactly what you ask, but you're better off looking at the heart of your issue:
You need a loop.
Put a WHILE loop around the part you want to do repeatedly.
Create a STOP button to stop the loop.
Do your once-only INIT stuff outside the loop, and make sure the INIT part passes something into the WHILE loop
(to make sure the loop doesn't start until after INIT).
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-03-2012 09:40 PM
Steve,
Thank you for your quick response. I will try that first thing tomorrow.