I have made this code which can transmit a signal through output channel of the board into the water pipe from one end and then receive the signal from the other end of the pipe into the input channel of the same board. The write and read operations in my code are synchronized. Currently, I am sending a sine burst of 1msec duration followed by 1 second of zero voltage. So, my daqmx write task is sending this wave (sine burst+DC) repeatedly. But I want that mmy output channel should be able to do frequency sweep, ie my first output signal should be sine burst (5KHz) of 1msec + 1 sec DC, immediately after this next signal should be sine burst (6KHz) of 1msec + 1 sec DC......upto sine burst (50KHz) of 1msec + 1 sec DC. Basically, I want to sweep frequency using sine burst (with 1 sec gap between two burst) in step of 1KHz and simultaneously perform the read operation too. I have attached the vi. I have also attached the image which shows the desired output at the output channel.
How can I continuously update the daqmx write after running the vi so that it can send the desired signal rather than repeating the same signal again and again?
Most of my "analog" experience has been with Analog Input, not Analog Output (except for slowly-changing output). In particular, I've not worked with a AO device that (like your 6281) incorporates a FIFO and a clock to drive the AO signal.
Suppose you generate a waveform (say, a single cycle of a sine wave) with, say, 100 points (you can use more points to get better resolution, or you can do a little filtering of the output signal). If you set up your AO device for Continuous Sampling with FIFO regeneration, and have already loaded the 100 samples into the FIFO, then if you set the output rate to 500KHz and output samples for 1 second, you will generate a 500KHz/100 = 5KHz sinusoid for 1 second. I haven't looked carefully into the triggering ability of the 6281, but if you can trigger it to start and stop, then your time-critical loop will have almost no processing and will not take appreciable time (so the timing will be accurate). If you want to output 0 volts, all you need to do is replace the 100-point sinusoid with 100 points of 0 in your FIFO (I'm just doing this to keep the overall-logic as simple as possible).
So a sequence could be as follows:
Note that this is only the AO side of the equation. Take advantage of LabVIEW's parallel nature and run this code in parallel with your AI code. If you need to synchronize the AI with the 1-second "clock" of the AO, the two loops can use the same Clock Signal.
Thanks a lot for your reply.
Can you give me some kind of sample vi or related link which can show the basic framework for implementing parallel loops for output and input with continuously changing output?
I got your point. For continuously updating the daqmx write, I have to put it in a loop. Now, should I put it in the same loop with daqmx read or in the parallel loop?
If I will put it in a parallel loop, then will there be synchronization between generation and acquisition like it was earlier?