LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Engine Pressue Acquisition VI Help

Hey guys,

 

I need to combine two VI's and need some help and advice on that.

 

So basically I have an engine running at 600 rpm. The first program I have is a pressure acquisition program which is a finite sampling type. I've attached the VI below and labelled certain portions that are not need. The sample clock uses the encoder B signal as it's source. The Z signal is used to trigger data acquisition. The encoder has a resolution of 0.5 deg so I basically get 720 pulses per revolution. At a speed of 600 rpm, that gives me approx 7200 pulses per sec. I have a 6040E card which I use for this and use one counter (Actually it might use both counters since it is a finite acquistion, not sure about this).

 

The second VI is one that measures the time between each encoder pulse. This is done to basically get a very highly precise timestamp so that I can correlate my pressure readings with images from a high speed video of combustion. This is basically a modified period measurement VI. Again, it starts with Z signal and measures time between the encoder pulses so uses the encoder as a source. It uses one counter off a 6601 card.

 

Now what I need to do is just combine both the above VI's into one main VI and write the values to a spread sheet. The first column must have the crank angle degrees like 0.5, 1.0, 1.5 etc although I can omit this column. The next two are very important. One contains the pressure value and the next column must contain the time stamp or time elapsed between the pules. When I run the VI, I just want N cycles of data, so 2N revolutions.

 

1. What would be the best way to combine these VI's? Should I convert the pressure VI to a continuous acquisition with a while loop and then combine parts of both VI's within the same while loop? Can a common while loop for both work? Will it affect the processing of the other?

 

2. What is the best and quickest way to log the values? Should I just use the write to measurement express VI? Will this slow down my acquisition? And should this VI be place inside or outside the loop?

 

3. Do both VIs need to match in the type of acquisition? As in, do both have to be finite or continuous or can one be finite and the other continuous?

 

4. Since the B and Z pules of the encoder are used by both the VI's, can the same terminal be used in both VI's?

 

5. How do I record a fixed number of data? Example 5 cycles or 10 rotations.

 

I'm sorry if some of these questions seem basic or stupid as I'm still a rookie. I would be really very grateful for some help and guidance.

 

Best,

 

Reuven.

 

 

 

Download All
0 Kudos
Message 1 of 14
(4,940 Views)

Hello Hello reuvengomes!

 

1. You should be able to put both task in parallel, and include in the loop the acquisitons.

 

http://digital.ni.com/public.nsf/allkb/96FD2F4685065C7686256F25006EE8DE

 

2. http://zone.ni.com/reference/en-XX/help/370469AG-01/lvdaqmx/mxwrite/

 

3. If you are gonna do finite then a while loop is not gonna be necessary, but for the continuos it would, so you just need to flat sequence the process you want to do at what time...to be executed at the same time.

 

4. Have you thought about exporting the signal to a different channel and use this channel in the other task

 

5. I don't really understand your question, if you mean logging data after certain rotation, then we need to generate another task that counts the phase of the encoder to do the logging.

0 Kudos
Message 2 of 14
(4,888 Views)

Hi, 

 

Thanks for responding. I've combined the program and tried running it but am getting an error. I've created another thread. Here is the link: https://forums.ni.com/t5/LabVIEW/Error-89215-occuring-at-DAQmx-Start-Task/td-p/3652308

 

Could you please take a look and tell me what mistakes I've made here? I'd be really grateful as I can't seem to figure it out.

 

Reuven.

0 Kudos
Message 3 of 14
(4,883 Views)

I see the other thread is solved, do you need further assistance?

0 Kudos
Message 4 of 14
(4,865 Views)

Yes please! Kevin had modified my VI and uploaded it to a different thread, the link to which is the the solved post. I tried running it today and it still gave me some error about the start task. Could you take a look please? 

 

And thanks again for inquiring.

0 Kudos
Message 5 of 14
(4,863 Views)

Hey reuvengomes!

 

I read most of the thread with Kevin, he is giving you lots of help, Every suggestion giving by him is great, he did even notice what is supported by your device and what is not.

 

I do believe the issue you are seeing is because your device does not support it.

 

0 Kudos
Message 6 of 14
(4,842 Views)

Yes he has helped tremendously! That kind of troubleshooting is way beyond my level right now. 

0 Kudos
Message 7 of 14
(4,830 Views)

Hello Reuven,

I am very new to LabVIEW and working on acquiring pressure data from the engine cylinder. I wanted to ask you that in the attached vi for pressure, how you have taken the rate of sample clock as 500 Hz and why you have chosen N channel and N samples in DAQmx Read while you are getting data only from pressure transducer i.e., only one physical channel.

0 Kudos
Message 8 of 14
(3,385 Views)

Do some more searching around here and you should be able to find other examples.  I've never worked on engine pressure data collection but have been in numerous discussions about it over the years.

 

Now then, to your specific questions:

 

1.  When using an encoder as a sample clock, I would set the 'rate' input to DAQmx Timing according to the *highest* expected encoder pulse rate.  This becomes important for Continuous Sampling tasks which might automatically choose a buffer size for you that's *based* on sample rate.  However, AFAIK  the 'rate' input is irrelevant for Finite Sampling tasks.

    Bottom line: with a variable-rate clock source, the 'rate' input can't be 100% true.  The best practice is simply to avoid *under* estimating the rate.

 

2. N-channel wasn't strictly *necessary* but may still be a good idea if there's any chance you'll want to measure other signals in the future.  (Voice of experience: stick with N-channel b/c it's pretty likely you or someone else will want to capture some other signal sometime in the future).

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 9 of 14
(3,358 Views)

Thanks, Kevin for your response,

I am using the code given in this thread.

I am using a function generator to simulate the signals related to the engine cylinder data i.e., a sine wave of 10 Hz to represent the engine pressure, a digital square wave of 72000 Hz to represent A or B signal from the encoder having a resolution of 0.1 degrees and a square wave of 20 Hz representing the Z pulse of the encoder.

I want to acquire the signal from the sine wave whenever a pulse comes up in a square pulse train. I want to start this process by triggering it with a Z pulse and then taking signals continuously.

I am using NI USB-6351 for this work.

I have connected the sine wave to the analog input terminal AI5, square wave to PFI12, and Z pulse to PFI13.

If I want to take data for say 20 cycles i.e. 20 sine waves, then I have some doubts, 

1) What value should be taken as rate and samples per channel for the sample clock.

2) what value should be taken as a number of samples per channel in DAQmx Read.

 

 

0 Kudos
Message 10 of 14
(3,315 Views)