LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help me with this code please

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(2,197 Views)
Solution
Accepted by topic author LostNProgramming

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).

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 3
(2,194 Views)

Steve,

Thank you for your quick response. I will try that first thing tomorrow.

0 Kudos
Message 3 of 3
(2,186 Views)