LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Encountered Error while continuous acquisition with external clock

Solved!
Go to solution

Hi all,

 

I am trying to acquire Pressure data against engine crank angle. 

What I want to see is pressure pulse vs engine crank angle.

Currently, I am using NI-6211 to get pressure signal through analog input.

As for crank angle, I use encoder which has 1024 pulse per revolution and Only A signal is used for edge counting for converting to rpm and for external clock source.

For start trigger of pressure data, TDC signal is used (PFI3).

So, when the start signal is triggered, acquisition starts by external clock of Encoder A signal (1 revolution -> 1024 samples).

There is no problem at low rpm but high rpm above 2500 or 3000 rpm, I encountered error (200019 and 200279).

It seems overwritten at high rpm.

Theoretically, at 3500 rpm, sampling rate is just around 60K samples /second.

It's still under maximum rate of my device (250Ks/s).

I am stuck to figure out what cause this error..

I have played around with figure of Sample to read.

Sometimes it works and another time it didn't work.

Any suggestion or problem in my code?

Attached is Vi that I made.

 

Thank you.

Peter,

0 Kudos
Message 1 of 9
(3,921 Views)

It looks like your error -200279 (the negatives are important) is related to a buffer overflow. Since you are using continuous samples for both of your tasks, maybe you can change it to "N samples". If you need higher performance out of your hardware, you can switch the DAQmx functions rather than express VIs.

0 Kudos
Message 2 of 9
(3,910 Views)

Thanks for prompt reply.

Let me try on N samples mode.

If I still encounter same error with N samples mode, What else I can do to go through this problem?

Actually, all my measurement is under maximum sampling rate of my device.

So, It should work well...  I spent few weeks due to this matter,,,

any more suggestions?

 

0 Kudos
Message 3 of 9
(3,886 Views)

I have tried as you suggested.

I still got the same error.

At high rpm above 3000 rpm, I encountered the error.

Is there any way to solve this matter?

 

 

0 Kudos
Message 4 of 9
(3,876 Views)

Hi all,

I am trying to measure engine intake & Exhaust pressure pulse against crank angle.

Crank angle is measured by 1024 PPR encoder which is used as external clock.

Also, TDC sensor is used as start trigger.

I have tried both continuous and finite mode to avoid error, but I still got same error.

For example, at 1000 rpm, the sampling rate of DAQ system is 1000rev/min * 1024 pulse/rev / 1min/ 60s =17066 Hz * 2channel =34,133 Hz

This is far lower than aggregate sampling rate of my device (NI-USB 6211 - 250k sampls /s).

It shouldn't be any problem.

I don't know how to figure out this problem.

Is it external clock problem?

I will appreciate any assistance and comment on this issue.

 

 

 

Download All
0 Kudos
Message 5 of 9
(3,891 Views)
Solution
Accepted by topic author Aiman_Peter_Kim

The main problem is that you use Express VI and the useless dynamic data type.

Move to using real DAQmx programming. That Express VI opens and releases HW resources at EVERY iterations.

http://www.ni.com/product-documentation/5434/en/

 

edit: I recommend using a Producer-consumer design pattern. Your producer loop only does the data acquisition, and NOTHING else. Thus, data logging and data manipulation will not affect the DAQ sampling.

You can use a Queue to transmit the measurement data to a parallel consume loop, where you can do data logging etc just fine...

0 Kudos
Message 6 of 9
(3,874 Views)
Solution
Accepted by topic author Aiman_Peter_Kim

It was already suggested what you need to do: forget using Express VIs, and program your task using DAQmx VIs. By the way, you started two posts with the same topic, I ask an admin to merge them together:

https://forums.ni.com/t5/LabVIEW/Buffer-Overflow-during-continuous-data-acquisition-with-external/td...

0 Kudos
Message 7 of 9
(3,864 Views)

No reason to start a new thread for the same problem.  So I merged them.

 

As far as your latest VI:

If you want continuous aquisition, then 1) get rid of that Boolean control and 2) use the logging tab in the DAQ Assistant to do your logging.  So your code should not have the case structure, sequence structure, or Write To Measurement File.

 

If you want finite aquisition when you press the button, the 1) change the button to be latched (eliminates need to reset it) and 2) use an Event Structure.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 9
(3,855 Views)

Once I programmed DAQmx VI instead of Express Vi, it works well without any problem.

For high speed data acquisition, programmed DAQmx Vi would be better.

Thank all who gave help. It was very helpful! 

0 Kudos
Message 9 of 9
(3,825 Views)