09-05-2013 04:10 PM
Hello,
I'm using labview 2012 and am trying to turn on a signal for a specified length of time in labview at the press of a button. The signal goes into an AO (PXI 6723) through my system, where the voltage gets divided by 2, the read in through the AI (PXI 6225). I want to write and read voltage constantly and then have a spike of voltage after pressing a button in LabView while still reading the voltage value for the specified amount of time.
Parameters:
My specified delay time does not match the elapsed time. I am having difficulties doing this. I have attached the VI.
( I can't upload a functional VI since it shows "the contents of the attachment doesn't match its file type") How can I attach the VI?.
Thanks!
Eduardo
09-05-2013 07:06 PM
Picture of the block diagram:
09-06-2013 07:25 PM
Hi Eduardo,
Would using a loop defined to run only for a set amount of iterations be a plausible alternative?
This way you would not acquire your 3 volts for a set amount of time but for set amount of samples. This would be a simple work around that can potentially work for your application.
09-07-2013 02:34 AM
If I were doing it, I think I'd setup two DAQ tasks: One for the output and one for the input. I would then set both tasks to clock and trigger from the same sources.
At run time I would load up the output buffer with an array of values long enough for the entire test cycle, or at least get it started, and then trigger the two tasks. Depending on the total length of the test and the desired clock rate, I could either read the input data as it is acquired, or read the entire buffer at once when the test ends.
Because all the DAQ timing is being done in hardware, the output updates and the input samples would occur at exactly the same time and so could be referenced to each other.
Mike...
09-09-2013 01:35 PM
Hi MJ,
Thanks for your answer, I really appreciate it! I have 32 channels where I have to input and collect the data. having a number of iterations in a for loop won't work for me since I have to read the voltage continuously on the same loop iteration to have the best resolution. I think.
09-09-2013 02:16 PM
Mike,
Thank you for your reply! I greatly appreciate it. I currently don't have any DAQmx timing in my application. I tried using it and, without really understanding how it works nor how to manipulate it, the whole test end up taking a long time to change the values i.e. too slow.
The DAQmx timing I used was the sample clock since it was for analog signals, but I don't really understand the buffer, what that means nor how to use it. inputting a rate time for it also made my test slower. The rate time is the samples per channel per second, but I'm not sure how to determine a number so that I am collecting the data I need and take into account aliasing.
I know the PXI 6225 has the capability to read 250kS/s (which I am assuming it's kilosamples per second or 250,000 samples per second). I am using 32 differential channels. I have read that I have to divide the maximum sample rate by the number of channels, (250kS/s / channels) but I don't know if I should count the number of total channels (64) or differential channels(32). In other words, is the per-channel maximum rate:
Furthermore, If I know the number of samples per channel per second, how can I implement that knowledge to the DAQmx sample clock so that my sampling is as fast and as accurate as it can be?
I attached an image of my DAQmx functions in my code, I merged all the stacked sequence structures in paint so you can see them.
thanks for your help!
Eduardo
09-10-2013 06:24 AM
First thing, don't use sequence structures. They make it impossible to tell what is going on in your code.
Second, your maximum per channel sample rate is defined by the number of channels you are sampling. If you are reading 2 channels it's 250k/2, if you are reading 4 channels it's 250k/4.
Third, check out the tutorials. There is one that explains buffering.
Mike...