11-08-2006 06:49 PM
11-09-2006 08:16 AM
Hi!
Just configure your acquisition to take one sample, before calling the DAQmx Start.vi place the DAQmx Trigger VI, configure it for external trigger source and digital edge (rising/falling). One terminal of this VI is to set the pin for the external trigger signal. So, what happens is that if a trigger occure you acquire one sample.
But keep in mind, the analog input is not retriggerable, so if you want to do this continiously, you will need two counters (they are retriggerable). So i would suggest to search for a example, using the LabVIEW example finder (Help menu) with the keyword "retriggerable", so you will find a example for retriggerable I/O
Hope this helps, Christian
11-09-2006 05:16 PM
11-10-2006 01:33 AM
Hi bawuer2,
The VI you posted is quite interessting!
I think, if you let the "retriggerable AI" VI as it is, without any changes your application will work fine! For example, you are wondering why there is only one value in the table after the acquisition....., it's because you are reading only one sample (see configuration of DAQmx Read.vi). The next thing is, where are the counter you have to use for retrigger AI in your VI. I can't find a counter task, however i found a DAQmx Create Task.vi which creates nothing?!
Attached you will find a VI which synchronizes AI, AO and makes it retriggerable with a counter, please have a look at and try to find out how to make a AI retriggerable. Then you can build up on it with a few little changes!
Christian
11-11-2006 05:19 PM
Ok, I worked on it some more and what I have is attached. I tried to enter the counter but it didn't seem to work. Should the source of the counter and the source of the digital start trigger be the same? It gives me the right graph and data table with no trigger so it seems that the trigger or counter is not working.
The bottom part of the vi is where I try to read in the digital trigger that is provided to the card and I tried to use the digital waveform to enable the table that records the analog voltage when the digital waveform is high. When I set it to single channel, multiple samples, waveform, I can get a waveform that seems to be what I want but I cant convert that into boolean that will enable the table when the signal is high and disable the table when the signal is low. If I can do this it seems that I would be able to just continuouosly sample the analog signal but only record the values when the digital signal is high which would mean I wouldnt have to use any counters of digital start triggers. Do you know how I can convert the output of the digital read to boolean somehow and use that to enable or diable the table? Ive tried setting the digital read to single sample, boolean, but always seems to give a false value.
As I said I attached the vi again, the top is the clock, the middle is the analog input, and the bottom is the digital input we want to use to determine when to sample the analog input. Thanks for all of your help.
11-13-2006 08:14 AM
11-13-2006 10:03 PM
11-23-2006 11:47 AM
Hi bawuer2,
First off all, NI call trigger as an event that will performed on a internal/external digital or analog edge, like to start a acquisition. You want to acquire a signal everytime a trigger occours, and this continiously. Now the problem is that the analog input is not retriggerable, which means you can perform an acquisition only one time with a start trigger. To make it retriggerable, you need two counters, which is demonstrated in the example you will find under the LabVIEW example finder.
If you also need to produce a output signal to your hardware to get a trigger from, you can do this with the digital I/O (bad thing with the 6024E, because there are static I/O which means that there always a interrupt occour if they change there states, so you can perform as a maximum frequency maybe 15kHz) or you use the analog output to generate this signal by creating an continous output with the desired frequency and the voltage level you need.
And this three components, you can synchronize with each other, like the VI i posted shows!
BR, Christian
11-24-2006 11:41 PM
11-26-2006 09:50 AM
Ok after yesterday here is my code attached. I am still having two problems. The first is that when I hit run, the values go into the data table on the front panel but it takes about 10 seconds to get .1 seconds of data into the table. The indicator that I have to read the time after the analog read is really slow. It seems that I am putting a lot of values into the buffer which I should but they are not getting read out fast enough. I have it set to analog single channel single sample because I only want to read one value when the trigger goes high. Is there a way I can continue reading out from the buffer after the program is stopped? Or a way to read faster from the buffer?
The other problem I am having is that I want to have the amplitudes go into the table having the first 64 amplitudes going into the forst column, the next 64 into the second column, and so on continuosly. If I dont include time data in the build table vi how can I manipulate the amplitudes coming out of the block to go into the column that I want?
Thanks for all of your help.