05-12-2009 08:35 AM
Hello,
I have an analogical signal with a certain amount of samples, that I put on an analog output.
I created an array of boolean of the same size.
How could I do so that this array becomes the trigger source of an analog input ?
Is it possible to do this internally (programmatically) ?
Thanks for your help
Felix
05-12-2009 06:30 PM
05-13-2009 03:09 AM
Thanks for your interest.
I might have not well understood how triggers should be used. Here is what I'd like to do :
I'm using a NI-6221 PCI
I first created a signal made of growing ramp and step functions, that is to say the value grows gradually from 0 until a first value, keeps this value for a while, then grows again to a second step and so on... I would like to start a measurement (limited samples) for every step. But I multiplied this signal with a sine wave, making its triggering a bit more complicated. For this reason, I created an array made of booleans of the size of my first signal. It gives a 'true' (impulse) every time a step begins.
Now here is my problem : while I put my "growing-sine wave" signal on an analog output and "listen" to an analog input to measure, how could I use this boolean array to trigger my measurements ? Should I also send it as a signal on some digital output and physically link it to a trigger input or is there a possibility to do this internally/programmatically ?
Thanks
05-14-2009 07:08 AM
Here is a simplified version of my VI.
The arithmetical part creates my analogical signal and the corresponding boolean signal.
Above the analogical signal is sent to an output. Then there is a while-loop reading the current value of the boolean array (array index given by the loop index). If TRUE then the aquisition starts and read a finite amount of samples. The problem of this implementation is that it is not very accurate. That's why I would like to use the boolean array as a trigger source.
Thanks for your help
05-14-2009 10:09 AM
Hello Felix_and
you can´t use the boolean array to trigger directly the AO source. If you use an Windows System you have an jitter from it and so the software timing is not exact. I have added an picture, how you can get a little bit more performance with your triggers.
What you also can do, is to make an synchronisation between your AO and AI so both start togehter. In the LabVIEW example finder you can find some VI´s for synchronisation of AO and AI for the DAQmx driver. Here also is an tutorial for doing this
http://zone.ni.com/devzone/cda/tut/p/id/3615
best regards ALEX
05-14-2009 12:06 PM
Hello Duffy2007,
Thanks for your answer. In the meanwhile, I tried to change my approach a bit but I still have a problem. I'd like to write the content of my boolean array on a digital output. Which VIs should I use to make the conversion "boolean array 1D"/"digital waveform" ? (I got an error from the "Digital Write" VI saying my waveform contains 8 lines but my channel has only one line)
05-15-2009 02:05 AM
Hello Felix_and
I have used the Write Dig Chan.vi from the example finder. In this Example you can configure only one line for an output, also reconfigure the the polymorphic Write DAQmx.vi to one line one value.
best regards ALEX
05-15-2009 06:00 AM
Hello Duffy,
Thanks for your help. I tried to use the Write.vi with this configuration (1 line 1 value) with a loop but it didn't work.
So I converted the boolean array in a 16-bit integer array and used the Write_(1channel N samples) VI. For my VI (see attachment), I connected the PFI9 input to the Port0/line0 output.But with this VI I get an error relative to the size of buffer and data to read that I can't understand.
05-15-2009 07:16 AM
Hello Felix,
but the read function into a while loop, then it should work, also set the timeout a little bit higher like 4 to 10 sec.
best regards ALex