First of all, thank you for your suggestions to solve the problem.
I use PicoScope 2408B block mode to develop waveform reading interface. When I use a signal generator to generate a 5V sine wave, I actually get a sine wave with a amplitude of 500mV. I compared my code with officially released block mode code but I can't find the actual error.
I found during debugging that after I run the 'GetValue()' statement, the maximum amount of data stored in the A-Channel buffer I set up is about 4000, Which means after 'adc to mv', the voltage I get is about 500mV, but my actual peak voltage was around 2.5V.
The attenuation factor of the oscilloscope probe is 1. The coupling mode is DC coupling, the voltage range is also set to 5V. I wonder what the problem is, I can provide all the code if it necessary, thanks for answering it for me.
The Pk to Pk voltage looks like 1.25V which is half of the signal generator voltage.
The generator is probably specified to output the 5V into an open circuit, but as you are connecting to a 1MOhm input impedance scope and you have the generator set to high impedance, you have a 1MOhm + 1MOhm voltage divider. What you are reading is therefore correct.
Mr. Martyn thank you very much for your reply.
I think it's a reasonable excuse for this situation. But I connected the signal generator directly to the PicoScope, I ran both the block mode routine and the program I wrote myself, and got different results.
The block mode routine can get a result of -2.5V but my program can only get about 600 to 750mV, and most of my programs are written to routines, so I thought maybe I was wrong in some details.
Here are the results of the block mode routine under the same conditions.
Sorry for not replying to your message in time due to netlag, thank you for your reply.
The program is still debugging. Here are my code and some instructions.
Initial parameter:
timebase = 27;
sample count = 100000;
sampling rate = 5MS/s
The sampling rate can't adjust yet, Because I'm still learning how to use multithreading, .
I think I know what the problem is. I put the channel Settings and time base Settings in the program initialization, but I didn't run openscope until then. The start button (after opening the scope) didn't contain channel settings because I intialized it. Thank you for answering my questions!