The voltage read by the NI test tools and Voltmeter are both 3.3V, but the data read by python with nidaqmx is 2.0 or others. The problem only occurs in NI USB-6210, which doesn't occur in NI USB-6341.
Hahaha, I have solved the problem !!! The default setting of the input configuration is "difference", which is not right for us. What we need is "RSE". So in the python code, we should set the "terminal_config". like:
task = nidaqmx.Task()
task.ai_channels.add_ai_voltage_chan("Dev2/ai0", min_val=-10, max_val=10, terminal_config=nidaqmx.constants.TerminalConfiguration.RSE)