LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Raster scan implemented via DAQmx and NI USB-6221

Hello,
I am trying to "draw" images using a scanning laser. Thus far I'm able to Raster scan via the two analog output channels on my NI USB-6221. Also, I can modulate the laser beam with the one of the digital outputs of the DAQ. However, an apparent limitation of DAQmx is that one can not perform simultaneous "tasks" (such as analog out and digital out), and I am at a loss as how to proceed. Other threads on this topic do not explore some of the possible alternatives.
 
The facts:
OS: Windows XP Pro, SPII
Labview 8.5 Pro
NI USB-6221 DAQ
Laser modulation frequency from 1 kHz to 2 kHz (digital control)
X & Y scanning via Galvanometer, frequency less than 1 kHz (analog control)
 
Some ideas I have:
  1. Raster scan comprises two defined analog waveforms with fixed frequencies and phase relationships. Only the digital modulation requires continuous control. Can the two analog channels be stored locally to the hardware, so that the only active "task" is the digital output task? (Or the opposite, where the digital output is stored locally?)
  2. Given the relatively low modulation frequency, can the analog and digital tasks be multiplexed? E.G. switch between the two tasks perhaps by matching the sampling frequency of the analog output channels to the digital modulation frequency. I think this would be a better solution.
  3. Some other method?

Thanks for your help!

-Joshua.Robot


--
Show me the math!

[All correspondence herein are privileged and the exclusive property of the sender and intended recipients.]
0 Kudos
Message 1 of 5
(5,224 Views)

Ok, I found [this article] which solves my problem. (I think.)

0 Kudos
Message 2 of 5
(5,201 Views)
Hello Joshua.Robot,

Thanks for your post!

I see that you are trying to sycronize you different tasks. I think you are on the right track as the site you have list has many great examples about how to sync different task and with different devices.

M Series Synchronization with LabVIEW and NI-DAQmx

Also take a look at some of the example programs that labVIEW ships with it. You can find these by going to Help >> FInd Examples  then in the browse tab go to Hardware Input and Output >> DAQmx >> Synchronization. Let the forums know if you have any other questions reguarding this.

cheers

Corby_B
http://www.ni.com/support

0 Kudos
Message 3 of 5
(5,180 Views)
Thanks Corby for your reply.
 
I've constructed a VI that gets me closer to what I want to accomplish. However I'm having some trouble with it. (Please refer to the attached larger images or  the VI.)
Based on some examples, I've created a DAQmx based VI that controls a NI USB-6221. The task synchronization is done via a counter, which provides the time reference. This aspect of the application works to my satisfaction.
Within the While Loop structure, three perodic waveforms are created (again based on an example), two of which are for analog output, the third is for a digital output. I've structured this in such a way to demonstrate that I wish to output three arbitrary waveforms and be able to continuously update them. This is especially important to accomplish for the digital output. Presently this does not work to my satisfaction.
Note the Property Node DAQmx Write. In this VI it is set to Allow Regeneration. This is a problem, as this causes the analog waveforms to become non-contiguous with respect to phase when  they are regenerated by the Basic Function Generator vi's after every "N" samples.
When the Property Node DAQmx Write set to Do Not Allow Regeneration the VI fails with "error -20016 memory underflow".
 
I need some way to continuously update all channels such that the output waveforms remain contiguous. Also, have I misplaced the Property Node, should their be an additional Propery Node for the digial waveform?
 
Thanks,
Joshua.Robot
Download All
0 Kudos
Message 4 of 5
(5,173 Views)
Hello Joshua.Robot,

Thanks for your post back! Just so happens I have a PCI 6221 and was able to run your program. When I did this and looked at what was coming out of your digital ports DevX/port0/line0 and DevX/port0/line7 and I was able to see a continuous digital wave form out. Is that what you are wanting to see? The Digital waveform chart does not look like it is updating because the waveform is the same every loop iteration so there appears to be no change. Your analog out is also continuous. Let me know if you have any further questions!

Cheers!

Corby_B
http://www.ni.com/support
0 Kudos
Message 5 of 5
(5,148 Views)