Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

digital frequency and analogue measurement

Hi, guys, I am using this program to measure some data from an engine(NI USB 6218).

 

1.  i have three switches to start the engine. when I run the program, i switch them on and they will generate continuous digital signals

2. 13 analogue channels for  the measurement of temperatures and pressures. I put them in one task as the analogue measurement

3. One counter is used to measure a speed pickup signal(digital) and its  frequency is read and recorded.

 

I tried to write the analogue data and the digital frequency into one file at a rate of one per second.

 

However, there are some problems,:when I run the program, it gave several error messages(the data to be acquired no longer exist). and when I pressed the stop button, it took a while to stop.

 

Could you please help me with that, thanks a lot

0 Kudos
Message 1 of 16
(3,972 Views)

Hi soundofwi,

 

I fixed couple of things in your vi:

1. At this low sampling rate, I'll use 1 sample on demand instead of continuous sample.

2. Use delay between loops instead of elapsed time.

3. Put DO task inside the loop.

Not sure whether what I modify is what you try to do, but you can modify my attached vi for further develop the project.

 

Regards, Kate

0 Kudos
Message 2 of 16
(3,968 Views)
hi, kate , thank you so much. I will try the program
0 Kudos
Message 3 of 16
(3,965 Views)
Hi, kate, I just tried the program you attached. and It only recorded one group of data and then stopped. The error occured was 200474 saying the specified operation did not complete because the specified timeout expired.
0 Kudos
Message 4 of 16
(3,952 Views)
By the way, I want the program to read the data as frequently as possible so I chose the continuous samples mode, but i only need to record the data once every second.
0 Kudos
Message 5 of 16
(3,950 Views)

Hey Soundofwi,

 

I have made some changes to the last VI which was posted up on this thread. These changes should allow for a seconds worth of data capture, and then save to file.

 

Basically there is a property node which gets the number of channels in the analog input task, and then devides the sample rate by the number of channels, thus giving the number of samples to acquire per channel in a second.

Then once these samples have been acquired they will be passed from the hardware buffer into the software and then stored to file.

 

Hope this helps.

 

Regards,

 

Steve

0 Kudos
Message 6 of 16
(3,930 Views)
Hi, steve.The vi you listed was for Labview 9 but the one I am using is Labview 8. Could you make another one if possible? Thank you so much
0 Kudos
Message 7 of 16
(3,924 Views)

Hi,

 

Sorry about that. Attached is the code saved in LabVIEW 8.0

 

Regards,

 

Steve

0 Kudos
Message 8 of 16
(3,919 Views)
 Hi, Steve, I tried your vi and it had the same problem as Kate's. the program only showed and recorded the data once the second i pressed the Run button and after a few seconds, the error message popping out saying the specified operation didnot complete because the specified timeout expired. I tested the task for the analogue measurement, it worked alright in the MAX and the acquisition mode was set as continuous, samples to read 100, rate(Hz) 1000. I changed it to 1 sample, but the program was the same.
0 Kudos
Message 9 of 16
(3,913 Views)

Hi,

 

The reason the code is only executing once is because the Counter Read function is timing out (giving you the error) and so it is stopping the loop, which is why the data is only being acquired and written once.

 

I would suggest having a look at your couter signal and revisiting the KnowledgeBase article I referenced in a previous post as it discusses a possible solution for the error.

 

Once this issue is sorted the acquisition part of the code will run as expected.

 

Regards,

 

Steve

0 Kudos
Message 10 of 16
(3,911 Views)