LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronize the signal sending and data acquiring process dynamically with one DAQ_Urgent

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

0 Kudos
Message 1 of 6
(2,480 Views)

Hi Memorysun,

 

Thank you for your post and welcome to the forums.

 

From your description what you want to achieve is:

  1.  Write data to a Analog Output channel that is then recieved by the Laser
  2.  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):

 

  1.  "Cont Gen Voltage Wfm-Int Clk.vi" (for continuous writing)
  2.  "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 S.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(2,468 Views)

@Jamie S. wrote:

Hi Memorysun,

 

Thank you for your post and welcome to the forums.

 

From your description what you want to achieve is:

  1.  Write data to a Analog Output channel that is then recieved by the Laser
  2.  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):

 

  1.  "Cont Gen Voltage Wfm-Int Clk.vi" (for continuous writing)
  2.  "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 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 6
(2,464 Views)

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

 

 

0 Kudos
Message 4 of 6
(2,458 Views)

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

Jamie S.

Applications Engineer
National Instruments
0 Kudos
Message 5 of 6
(2,439 Views)

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

0 Kudos
Message 6 of 6
(2,425 Views)