LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure pressure when a specified drop is recorded

Hi all
 
I am trying to record the pressure at which a test valve drops out.  I am slowly dropping the pressure of the valve until there is a sudden drop.  I would like to record the exact pressure at which there is a drop of 4bar.
 
I am currently using shift registers to display the result on the screen.  This works most of the time, but sometimes gives me the previous pressure reading to the one where the dropout occurs.
 
I think the following is happening:
 
The sample compression subVI outputs at 10 samples/sec. 
 
Most of the time, the while loop runs at roughly 10/sec, so 1 sample comes from the sample compression subVI per loop.  - This is when the reading is shown correctly. 
Sometimes the while loop runs below 10/sec, so 2 samples come from the sample compression SubVI per loop.  This is when the reading shown is the previous one.
 
I have tried adding a time delay to the loop so that it only runs at 5/sec and then 2 samples should be output per loop, but the graph on the front pannel becomes very jerky during run time.  I didn't go down this route once I realised the graph was jerky. 
 
Any suggestions would be much appreciated
 
Thanks
 
Nick
0 Kudos
Message 1 of 4
(2,631 Views)
Try setting your Daq Assistant to N samples instead of continuous samples.  That way you will get exactly 100 samples per iteration that will be reduced to 1 average.  I think what happens if the loop takes longer than you may get more than 100 samples, even 200 samples which gets reduced to 2 samples in the compression Express VI.
0 Kudos
Message 2 of 4
(2,617 Views)
Thanks for your suggestion.  I forgot to mention that I have to record to an lvm file at 10 samples/sec per channel.  The while loop runs at <=10 /sec.  If your suggestion is the way to go, should I increase the RAM in the computer.  Will this help to maintain 10/sec?
0 Kudos
Message 3 of 4
(2,586 Views)
Hi Nick,
What ravens fan suggested is right. Increasing or decreasing the speed of the while loop depends on the code within the while loop amongst other things. If you want it to run faster, you could probably reduce the logic in the while loop or write a separate while loop altogether.
If you want to measure the time inside the while loop, here is a good method.
Increasing your processor speed could increase the speed of the while loop and the same with RAM but it all depends on what is in your while loop and also background processes on windows etc. It is not guaranteed that doing so will increase the speed because it depends on so many other things rather than just the code being executed.
Best Wishes,
0 Kudos
Message 4 of 4
(2,565 Views)