From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Gain changes on sample rate change

I wrote an application with 2 channel analog input with different gains. If I change the sample frequency the gain setting seems to mix up. But the sample frequencies work if used as first. So, only after changing the sampling frequency the gains are mixed and could not be 'reset' by calling Scan_Setup() from NIDAQ library again.
Any ideas?
0 Kudos
Message 1 of 3
(2,142 Views)
Hello,

So it seems that changing the sampling frequency is affecting the gain of a channel?

I am not that sure what is causing this behavior, if you could answer the following questions, we could begin to figure this one out.

1.) How do we know that the gains are mixed up? Is one signal significantly larger then before? Is the code width decreased?
2.) Are you trying to change the sampling rate during acquisition? Are you running the acquisition to the end, then calling Scan_Setup again?
3.) Do you get this error if you call DAQ_Clear before reconfiguring the sampling rate?

Also, if you could post some pseudo code that explains which DAQ calls you are making, and their order, we should be able to get this problem figured out.

Best regards,

Jus
tin T.
National Instruments
0 Kudos
Message 2 of 3
(2,142 Views)
Hi Justin,
thanks for the answer.
I could solve the problem yesterday, but still do not understand the source of the problem.
I use a hardware software triggerd scan on button press.
So one scan at a time. The scan frequency change is done after a scan, not in between.
Channel 0 has gain -1
Channel 1 has gain 100
After change to higher sampling freq channel 0 works with 100 as well.
I solved it by setting the gain each time I change the sampling freq.
But I thought I could set the gain at initialisation and that's it.
Any how, it works now.

Thanks for your help
Klaus
0 Kudos
Message 3 of 3
(2,142 Views)