03-12-2012 07:58 AM
Dear Sir,
I am using one DAQ card to send a modulation signal (which is a signal summed by a low frequency saw tooth and high frequency sin signal) to the laser controller, and acquire voltage signal from another instrument (It is in a same measurement system with the laser controller)?
I would like these two process happening at the same time.
In the attachment, there are two parts, one of them is signal generating program, the other one is data acquiring program, how to do like this: when I press"run", first the modulation will be sent to the laser controller immediately, and at the same time, the acquiring program starts as well...
In addition, I think my program is not complete, could you please help me check if there are any other problems with it?
Thank you very much.. and appreciate your quick reply in advance.
Best regards,
Memorysun
03-13-2012 07:45 AM
Hi Memorysun,
Thank you for your post and welcome to the forums.
From your description what you want to achieve is:
This can be achieved using a single VI with 2 seperate DAQ tasks, one the "Continuously Writes" to the Laser and the other that "Continuously Reads" from the Laser/Instrument. Can I recommend the following examples that can be found in the NI Example Finder (Help>>Find Examples>>Hardware Input and Output>>DAQmx):
The code from within both these VI's can be placed in a single VI therefore achieving the desired functionality.
Many Thanks
03-13-2012 08:02 AM
@Jamie S. wrote:
Hi Memorysun,
Thank you for your post and welcome to the forums.
From your description what you want to achieve is:
- Write data to a Analog Output channel that is then recieved by the Laser
- Acquire (read) data from using an Analog Input channel (output from Laser/Instrument)
This can be achieved using a single VI with 2 seperate DAQ tasks, one the "Continuously Writes" to the Laser and the other that "Continuously Reads" from the Laser/Instrument. Can I recommend the following examples that can be found in the NI Example Finder (Help>>Find Examples>>Hardware Input and Output>>DAQmx):
- "Cont Gen Voltage Wfm-Int Clk.vi" (for continuous writing)
- "Cont Acq&Graph Voltage-Int Clk.vi" (for continuous acquisition)
The code from within both these VI's can be placed in a single VI therefore achieving the desired functionality.
Many Thanks
Jamie,
They would be better served with an example that routes the AO hardware sample clock to the source of an externally clocked AI.
Using the examples you posted will still leave them with the challenge of trying to alligh stimulus with response.
Ben
03-13-2012 11:01 AM
Thank you both! Jamie and Ben.
Yes, Ben, you are right. How to synchronize them, I do not really know . And also Another question is, can the "Cont Gen Voltage Wfm-Int Clk.vi" generate a summing signal (A saw tooth summmed with a sin signal )?
Looking forward to your response!
Thanks a million
Memorysun
03-15-2012 10:50 AM
Hi Memorysun,
There are a number of examples available, as Ben suggested the synchronized example "Multi-Function-Synch AI-AO.vi" is available, allowing you to synchroize the analog input and output operations such that each input sample per channel occurs at the same time each output sample per channel is updated, the operations will require a common clock source.
The example is avaiable in the "Hardware Input and Output">>"DAQmx">>"Synchronization">>"Multi-function" catagory in the NI Example Finder.
Regarding the creation of a summing signal, this is possible provided the waveform profile is generated in the correct manner, the method utilised in your original code should work.
Please let me know if you are able to create the summing signal successfully Memorysun.
Many Thanks
03-16-2012 11:04 AM
Hi Jamie,
I will try it out and will let you know how I am getting on.
The summing signal is fine, I have checked by using a scope.
Thank you very much!!
Memorysun