LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving 1 data point in countinuous mode

Solved!
Go to solution

Like this?

0 Kudos
Message 11 of 23
(2,356 Views)

The for loop will only run as large as your auto-indexed array is (the number of rows I believe). If this is something that you want running during your entire program, I don't think that will suffice.

0 Kudos
Message 12 of 23
(2,340 Views)
Solution
Accepted by topic author glskinner84

Take a look at this example, where the data logging loop is on the bottom. Try it out and see how the "Logged Data" indicator only updates when the timer has elapsed, this is where you put your code to write to spreadsheet.

 

Press the "Logging?" Control to begin the timer.

 

Typically I use queues to transfer data between loops and tell loops when to stop, but I figured you might latch on to the local variable idea faster.

 

Data Logging Loop.png

0 Kudos
Message 13 of 23
(2,326 Views)

I was actually just dumping some P/C examples to my 2012 system to play around with. I'll try your suggestion. 😛

0 Kudos
Message 14 of 23
(2,317 Views)

It looks like you beat me to it!

 

Here's my implementation with queues and stuff. The error handling could be done better, but now you have another reference!

(I resaved it for 2012)

 

The Continuous Measurement and Logging example project is another good reference.

Message 15 of 23
(2,306 Views)

Greg, you're a boss. I had no idea you could pass local variables to other loops. I thought loops were closed systems. It's so strange that I have a pretty good understand of what your code's doing but lack the imagination to come up with it. Thank you man. I'll run some tests tomorrow. Next step is putting timestamps next to each value in the file! Thank you man.

0 Kudos
Message 16 of 23
(2,291 Views)

No problem! If your company has a software subscription, it is definitely worth asking them if you can use it to go through some online training. The Core 2 course would probably be very worthwhile to you right now.

0 Kudos
Message 17 of 23
(2,277 Views)

This sounds dumb, but can I reset the timer with a button press? Or is this a stop/start?

0 Kudos
Message 18 of 23
(2,276 Views)

If you go into the false case of "Logging?" you can make the boolean shift register a "True" (right now it runs straight through). Now whenever you switch to logging mode it will reset the timer. You will have the most recent time target, but you could put some logic in if you want to get back to your first time target.

Message 19 of 23
(2,270 Views)

Sweet. I'm not sure if we have a subscription. I think we did at one point but my boss got tired of paying the 600$ or so a year. The courses are a couple of thousand dollars I think.

0 Kudos
Message 20 of 23
(2,259 Views)