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.