Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous waveform generation and "real-time" update

Dear all,

 

I want to ask your advice for my problem. I have 2 AIs, 2 AOs. The AOs are synchronized with the AIs (the sampling rate varies from 25 kHz to 100 kHz).

what I want to do is that: output bipolar rectangular pulses (from 60 us to 5s) and then stop (from 1s to 100s), and output the pulses again (with different amplitude). During this time, the AIs continuously acquire the signal and display. The whole process should be less than 1 second.

 

I tried the following flow:

1- Configure AIs, AOs: continuous sampling mode, sampling clock to synchronize, buffer

2. Write initial data to AO (including pulsing + stopping time)

3. Start AOs, AIs

3. Loop (while the task is not done)

            - read data

            - write data

            - display data on the figure

4. Stop and clear the tasks

 

However,  I get lagging time with the writing --> some of data in the acquisition are lost.

 

Could you suggest me any method to speed up the whole process? Should I use finite sampling mode? If yes, then I guess I should use a counter to retrigger the generate of the pulses again? In that case, where should I update the waveform?

 

Thanks a lot,

Alexis

 

 

0 Kudos
Message 1 of 2
(5,620 Views)

Hello Alexis,

 

What do you exactly mean with lagging in the writing?

Is it possible to provide the used code?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 2 of 2
(5,536 Views)