LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Taking average only when trigger signal is high

I am trying to detect the signal from a switched capacitor circuit which I attach to my DAQ (PCI-6024E) but I face a problem on how to take the average of the output signal when the clock signal is high (i.e. ignore the moments when the clock signal is low).

The attached file illustrates the problem. Thank you in advance
0 Kudos
Message 1 of 8
(3,709 Views)
I made a vi that could solve the problem, although it doesn't strike me as a great solution. The solution assumes that you have a 2D array with in the first column values of 0 (clock low) or >0 (clock high). The second column contains the analog channel values with your signal. I chose this kind of input thinking that you sample both channels as analog channels (although the clock signal wouldn't ever be zero in that case). The output is an array of averaged values.
It isn't a complete solution, but maybe it helps you toward a solution.

aartjan
0 Kudos
Message 2 of 8
(3,672 Views)
Hi aartjan, I'm unable to open the vi file that you have attached in the earlier message. This might be due to the fact that I'm using ver 6.1. Would it be possible for you to help me save it in a format that I can read?

Thanks a lot for your help. 😃
0 Kudos
Message 3 of 8
(3,654 Views)

I am sorry; I always forget to mention what version it was made with. It was indeed made with LV7.1. To my surprise 7.1 only allows me to save it back to 7.0 (7 express)!!! Probably if I had multiple installs, I wouldn't have this problem. But who uses several versions of Labview on one computer? I am posting a message on this forum right now to find out whether I can install something like 6.1 runtime to accomplish saving back to that version. In the mean time I did include a 7.0 version below. You could open it by downloading a free evaluation version of 7 express.
Maybe another reader using express can save it back to 6.1

aartjan

0 Kudos
Message 4 of 8
(3,642 Views)
Hi aartjan, many thanks for your help once again. I'll try to see if anyone in my lab has Labview 7.0. Again, thanks a million. 😃
0 Kudos
Message 5 of 8
(3,638 Views)
Also, at the same time, anyone who can help me convert the file to version 6 please help. Thanks. This is because the rest of my program is coded in version 6. Again, thank you. 😃
0 Kudos
Message 6 of 8
(3,633 Views)
I read in other threads that any Labview version can only save back to its previous version. If that is true, than 7 express will allow you to save it to 6.1 and 6.1 can save it to 6. If that is what you are using, this is a crazy and very un-Labview way of doing things. So I printed the vi to html and attached it to this message. It is not big so you can easily rewrite the code. That is, if it is what you are looking for: I made it sometime around 4am with only one eye still open and I suspect there are more elegant solutions possible. Good luck.

aartjan
0 Kudos
Message 7 of 8
(3,629 Views)
Hi aartjan, thanks for your help. Your program (vi file) has helped me a lot. Thanks a lot. 😃
0 Kudos
Message 8 of 8
(3,600 Views)