02-09-2011 03:46 AM
Just use seperate (independend) tasks for each type of DAQ. So task1 would be 2 AO for the mirror and task2 would be the pulse train.
If you have problems with these, you can run them on their own and measure the signal using a scope or multimeter.
Felix
02-09-2011 11:08 AM
I appreciate all the help so far from everyone.
I was talking with my advisor and after I explained my problems to him and showed him that part of the proposed solution is to configure two separate tasks he said that the most important thing is that the pulse train for the camera be in sync with the waveform output signal. He sounded concerned that if there were two separate tasks that the camera computer may not be in sync the whole time. Basically the camera needs to always be in sync with the scanning mirrors as they move.
02-09-2011 03:52 PM
Ok, you need sync of the tasks. This is one of the areas of LV programming I find most interesting and fun. Sadly, I never did the combination you require, so I can't detail the approach.
So at first, we do not want to handle such delicate timing on top of an OS (like WIN) -> latency in the ms range. So we do not program that logic directly in LV. Instead we use the timing engine of the DAQ device and just need to configure it correctly -> latency in the ns range!
So you still use 2 seperate tasks. Then you need to configure them to share start trigger and timebase (sampling clock). This might involve using one of the counters to generate the clock instead of the 'Onbord clock'. Strongly depends on the device(s) you use (PXI systems are very-very accurate for this, with usb devices sync several cards seems to mean troubles).
As said before, I didn't combine what you need, so google 'synchronization analog output pulse train site:ni.com' or the like. A posting on the 'multifunction-DAQ' forum (NI Discussion Forum : Most Active Hardware Forum : ...) will also help you to get attention of the NI-AEs that are working in this field.
Felix
02-11-2011 11:47 AM - edited 02-11-2011 11:47 AM
Okay, I think I'm getting close to having something that works. I removed the pulse train for now because I just want to get the waveform generators working. The error I'm now receiving is that the number of channels of the task do not match the number of channels of the data in the DAQmx Write VI (the Analog 2D DBL box). For some reason it thinks that the # of points of the input to the waveform generator VI (currently using 7760 to generate a smooth power law function) is the number of channels because it says in the error box that the number of channels of the data is 7760. Any help on this issue??
02-11-2011 12:06 PM - edited 02-11-2011 12:08 PM
Don't transpose the 2D array going into the DAQmx Write.
Also, please clean up your wiring. You have a lot of wires running backwards and behind other structures making the code harder to read.
02-15-2011 05:24 PM
Okay, so I decided to create a separate VI that just generates the waveforms to a 2d array and outputs it to a waveform graph to use as a subVI in the main VI. For now I've completely ignored the pulse train part, as I'm focused on just getting the signal of the waveforms to output correctly to both channels. I finally managed to get channel 0 to output some sort of vertically fast moving line and chanel 1 to output some weirdly skittery thing that looks like a step function on my oscilloscope. I'm thinking that this isn't the way things are supposed to look. Here is my latest VI screenshot attached:
02-16-2011 09:09 AM
Okay, it seems I just had to fiddle with the oscilloscope as everything is outputting correctly to it now. Now to implement the pulse train generator back again!