08-21-2007 09:40 AM
Hi,
I’m trying to calculate rise rate for a pressure measurement. It is defined as in the picture (riseratecalc.png). Up to t0 there is no applied pressure. After t0 there is an applied voltage and it increases. t1 is usually defined as t0 plus 1 seconds. Thus if I find t0 , I can find t1 and P0 and P1 (corresponding pressure values respectively). But there is a difficulty in finding t0 instant. When there is no pressure in the line, there is a very small, varying voltage (+3,+5,-3,-5 mV). (With my pressure calculation code I will calculate this varying voltage emprically then use this as threshold voltage. ) In order to accomplish this, I wrote a small code (riserate.vi) I created a voltage array with 10 elements and compared its elements with a threshold voltage. If it is equal or greater than this threshold voltage I break the while loop, grap this index (it shows t0 instant) and use this index number to find P0, then add a sampling ratio * t seconds to find t1 and use this index to find P1. Then I substract P0 from P1 and calculate rise rate. My problem is how to integrate this to my pressure reading code (press1.vi). I measure pressure from two channel, but I will use rise rate calculation only in outlet channel. I read the voltage values after mean.vi and pressure values after making scaling. It is probably more clear what I want to do in press2.vi. There are also some more issues. I run press.vi , it is working fine , measuring the pressure correctly. But when I run it highlight execution mode, it gives -200279 error. I read some messages related to this error, tried to solve playing with sampling rate and buffer size but couldn’t manage. I also didn’t understand why I get this error only in the normal mode. It is very annoying now to deal with this error while I try to analyze and fix the other problem. Finally, I put a over limit alarm in press1.vi, I took it from NI examples (Temperature System Demo) . But in that example it was hidden when there is no over limit. It only comes to display during over temp. But in my code it is visible all the time. I want to hide it somehow.
Meanwhile, I want to say that, there are very helpful people in this forum. I didn’t meet any replies in the other forums as quick and reliable as here. Thanks for your concern.
Ahmet
08-22-2007 02:45 PM
08-27-2007 04:02 AM
Hi Nick R
Thanks for your reply. But let me change my explanation about error -200279 in this way. Even though I use Cont Acq&Graph Voltage-Int Clk.vi example I get this error during highlight execution mode. Therefore I think the cause of this error can be different. My system is capable enough, I think (Intel Core Duo 2 GHz, 1 GB RAM) . I have examined all the messages related to this code, but I didn't see anyone complaining about getting the error only in highlight execution mode.
The other problem was solved when I set that boolean to be transparent when it was off.
Ahmet
08-28-2007 08:43 AM
08-29-2007 08:19 AM
Hi Nick,
I got what you mean, but I still need some clarification 🙂 Actually I use USB 6009 as hardware, but I use PCI 6221 virtually to simulate my programme. I've checked PCI 6221 specifications and found that its input FIFO size is also 4095 samples. My real card (USB 6009) has 512 bytes AI FIFO (which means 4095 samples). But what is the meaning of max. sampling rate in the specifications ( which is 48 kS/s for USB 6009, 250 kS/s for NI 6221) . In DAQmx Timing.vi we determine the sampling rate and samples per channel (buffer size for continuous acquisition). Thus I think 48 kS/s (for USB 6009) and 4095 samples are max. vaules for sampling rate and buffer size respectively. Am I right? Your comment also shows that I can not sometimes use highlight execution mode for code analyse effectively.
And I have another question, maybe I have to send it seperately with another message subject. I want to read some voltage values from a txt file (test.txt) and insert these values to an 1D array. I want the first value to be first element of the array, second value to be second element and so on.
Thanks for your concern.
Ahmet
08-29-2007 10:39 AM