11-10-2012 10:46 AM
Hi all,
I need to output an analog waveform triggered by a digital TTL input trigger. The analog waveform that is output must be changed at every trigger. The number of samples in the waveform is fixed. Every cycle of the analog waveform is known in advance.
Hardware is M-series 6221.
Any ideas if this is possible with the Mseries card?
Thankyou,
Ibboh
11-12-2012 10:32 AM
Hi Ibboh,
This is an interesting question.
This could be possible, however it will be software timed so the timing and determinism will not be completely accurate.
I'd like to clarify a few points:
You would like to change the analog output every time a digital trigger changes state. Would you like the channel to change or the waveform to change on the same channel? Will the waveform be on the same Analog output pin?
How frequently will the digital trigger change?
How quickly will you need the output to respond to the digital trigger?
Kind regards,
James O'Neill - Applications Engineer - National Instruments
11-12-2012 02:54 PM
Hi James,
It should be the same channel and the same output pin.
The digital trigger is fixed at a value between 20 and 100 hz.
The output must trigger immediately off the digital trigger and output data at 100ks/s. The waveform length is 1/10th of the time between triggers so there is time for the waveform to change.
I've managed to get something working but wonder if there is a better way.
I have a while loop containing an indexed waveform array which goes into a 1 channel n samples waveform daqmx control followed by a daqmx start. I then repeatedly query "is task done" before stopping the task. This whole loop must complete before each new trigger. It seems to work at the speed I need but I wouldn't be able to go faster.
As always with Labview, I'm sure there must be another and better way.
Cheers,
Ibboh
11-13-2012 03:17 AM
Hi Ibboh
Could you upload the code you have writen?
James