03-11-2009 12:38 PM
Hello,
Working on trying to put a display of how long the data log has been running to we can record approximate seconds since start when we change things in the experiment. The timer should only run when the switch is on. Also, is there a way to eliminate the delay from when the switch is pressed to when the log actually starts?
Thanks,
-JL
03-11-2009 12:39 PM
03-11-2009 02:30 PM
03-12-2009 02:12 PM
Ok great. I put that in and I think it can work with some tinkering. The problem is exactly what my other question was about. With my program structure it takes the value of data logger freq for the switch to become true and the time only updates then, and is incorrect. How can I move this around so it starts logging and counting as soon as the switch is pressed? Maybe ignore the timer for the first iteration?
Thanks,
JL
03-12-2009 04:16 PM
The issue is with your DAQ assistant. That is controlling the pace of your loop.
You are collecting 1000 samples as a rate of 100 mHz (milli Hertz) so 1 sample every 10 seconds, takes 10,000 seconds for the DAQ assistant to execute. But you actually have a default timeout of 10 seconds. So you wind up with only 1 sample anyway.
You may want to collect samples more frequently (1 sample, once per second) and only hold on to every 10th sample.
Take a look at a producer/consumer architecture so you can separate data collecting from logging.
03-13-2009 10:56 AM
I will be gone on a trip for the next 7-8 days, but I will work on it when I'm back in. Wouldn't it still wait the value of the data logging interval before it becomes TRUE and triggers the first log event?
-John
03-13-2009 12:43 PM
Fix your DAQ assistant first. What rate do you want to actually measure the data?
As it is right now, it is 1 sample every 10 seconds, and you are trying to collect 1000 samples. So the DAQ task won't complete until 10,000 seconds have passed. That is almost 3 hours. The DAQ assistant won't wait that long, it times out at 10 seconds. So your overall loop rate is one iteration every 10 seconds and only getting about 1 sample. Are you getting a timeout type of error when you run?
03-13-2009 12:49 PM
03-13-2009 12:59 PM
Set your DAQ assistant to be 1 sample on demand and put a 1000 millisecond timer in the loop.
Unless your DAQ assistant is somehow set differently than the VI you posted., I don't know how you are getting rapid update on your numbers.
03-13-2009 08:23 PM