I am using measurement studio 8.0 with Visual Studio, writing C++.
I would like to output a continuous analog signal through a PCI6733 card.
The amplitude and frequency of this signal have to be refreshed approximately
every 100ms according to values given by a simulation.
I think the more relevant example from measurement studio is the one called
"ConGenVoltageWfm_IntClkDlg" in the example files provided. This example
works nicely on its own, with my cards.
What i am trying to do is to refresh it without interrupting the signal already being sent.
To do so, i am calling the following bit of C++ code every time I want to update the
frequency and amplitude:
CFunctionGenerator fGen(m_task->Timing,
m_desiredFrequency,
m_samplesPerBuffer,
m_cyclesPerBuffer,
m_waveformType,
m_amplitude);
CNiDAQmxAnalogSingleChannelWriter writer(m_task->Stream);
writer.WriteMultiSample(false, fGen.Data);
The thing that happens is that the amplitude refreshes with a big lag time
(a few seconds) whereas the frequency is updating correctly every 100ms.
Moreover, this seems to take a lot of CPU power. This CPU consumption is
not appearing in the task manager surprisingly, but my dialog obviously struggle
to be moved. Maybe you have some ideas ?
I may be using a wrong technique ! It's more than likely actually 🙂 Thanks very
much for your advices !
Regards,
Laurent