07-22-2008 03:25 PM
07-22-2008 03:36 PM
07-22-2008 04:10 PM
07-22-2008 04:55 PM
07-22-2008 05:00 PM
07-23-2008 03:28 PM
Okay...I found a good video on NI about using DAQmx for inputs and outputs, and I've gotten both examples to work. I am now editing those programs to read in a K-type thermocouple one sample a second, and the duration of the program is entered in by a user prompt and is controlled by the Elasped Time VI. The program is operational. However, the program starts logging data even before the user enters in the length of the test. So, if I press the start button and enter in 30 seconds for the length of the test, the program will execute. However, when I open the text file where the results are stored,the file includes samples taken before I entered in the 30 seconds. How do you synchronize the logger not to start until the user enters in the test length information?
I've attached the VI for the program, and a .txt file of data logged.
07-23-2008 03:43 PM
07-23-2008 04:17 PM
07-23-2008 07:20 PM - edited 07-23-2008 07:29 PM
I don't think the number of samples that are written is necessarily going to be 30 when you run the loop for 30 seconds. I's going to be the number of samples that the DAQmx Read returns. You are telling the DAQmx Read to return however many samples it has available and you are not sampling once a second.
Edit - I just ran your VI and I keep getting an error. That's probably because you have it set to continuous. With the Write to Measurement File inside the loop, it takes too much time to write to a file each time. Try setting it to finite samples and requesting a fixed number of samples.
07-23-2008 07:27 PM