LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shameful program

Solved!
Go to solution

"Hello, this is really embarrassing, I don’t know much about LabVIEW. I need to collect voltage and current data live and send it to an Excel file. I've decided to use a single DAQ because with two (one for voltage and one for current), I was getting an error because the program doesn't understand the order of execution. Right now, I'd like to know if there is a better way to do what I’m showing here. I’ve decided to set a rate of 200 mHz to get an update on the indicator every 5 seconds, but I’d like to register a sample every 10 minutes in Excel. Another problem I have is that the Excel file cannot stay open while the program is running, and I would like it to be able to. Also, the time column isn’t working correctly. Finally, I would like to know why when I hit STOP from the front panel, it takes almost 10 seconds and sometimes it doesn’t stop the task. Thank you for your help, God bless you.

0 Kudos
Message 1 of 4
(237 Views)
Solution
Accepted by topic author Aros

Well, there are excellent training resources listed at the top of the forum. If you don't want to do the work, hire a contractor.

 

  • Execution order is fully determined by dataflow and you have full control over it.
  • If you don't want the excel file to be open between writes, what do you think will happen if you open it elsewhere and your program tries to write to it?
  • Please describe the meaning of "isn't working correctly". That's way too vague.
  • If you have a loop running every 5000ms, one of the first items in each iteration is reading the stop button (in parallel to all other code), This means that the TRUE will only get read again at the next iteration (up to 5 seconds later), which then takes another 5 seconds. Your observation is exactly as expected.
  • You need to create a proper state machine that can react to UI events at any time and initiate a proper shutdown procedure.
0 Kudos
Message 2 of 4
(201 Views)

All right, I think I got everything you told me.

Where can I find the training resources?

Also, I'm not sure if a state machine is too much for my purpouse of a couple of data acquisitions.

0 Kudos
Message 3 of 4
(168 Views)

On the top of the forum, there are plenty of links.

 

altenbach_0-1743187585426.png

 

LabVIEW also ships with plenty of example program and design templates.

 

A state machine is a very simple program design. In your case you would have states for reading, waiting (do nothing), writing, shutdown, etc. and logic to transition between these states (e.g. after 5 seconds, when new data is acquired, when data needs to be saved, when the stop button is pressed, etc.)

 

 

 

0 Kudos
Message 4 of 4
(161 Views)