02-23-2009 06:58 AM
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
02-23-2009 08:19 AM
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
02-23-2009 08:53 AM
02-23-2009 10:23 AM
02-23-2009 10:26 AM
02-24-2009
04:20 AM
- last edited on
11-07-2025
01:04 PM
by
Content Cleaner
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
02-24-2009 07:37 AM
02-24-2009 08:19 AM
Hi,
Sorry about that. Attached is the code saved in LabVIEW 8.0
Regards,
Steve
02-24-2009 09:00 AM
02-24-2009 09:04 AM
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