Jump to content
  • 0

Problem setting CH. 2 Voltage Range AD2


Jivoman

Question

Hello, I'm new to using the Analog Discovery 2 (AD2)  and I don't know if this is a "real" problem or if it's just the way it works.  I'm trying to use the SDK in order to write software to see if you can integrate the AD2 into our automatic tester.  Currently I have 2 signal generators connected to Channels 1 and 2 of the AD2.  Ch1 as a sin wave been generated at 2KHz with an amplitude of 5Vpp.  Ch2 has a sin wave been generated at 800Hz with and amplitude of 300 mVpp. The problem that I'm having is when I want to change the voltage range value for channel 2 using FDwfAnalogInChannelRangeSet handle, 2, 0.3 it does nothing.  But if I change the voltage range for channel 1, it changes the voltage range for both channels.  I have tried it with the python and command line example programs that come with the SDK and the same thing happens.  Is there specific sequence in with the commands have to be send or do I have to change something in the configuration of the device?

Any help is much appreciated.  

Thank you.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Hello attila,

I had already tried that.  When I use 0 as the channel (dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(0), c_double(5))), it adjust the the voltage range for both channels.

When I try 1 as the channel (dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(1), c_double(5))) it does nothing.   The last thing that I tried was putting the "2" just to see what it does.

Link to comment
Share on other sites

Hi @Jivoman

The Scope inputs of AD2 have 2 gain steps about 5V and 50V.
See the following script: AnalogIn_Range.py

# DWF Version: b'3.11.14'

dwf.FDwfAnalogInChannelRangeGet(hdwf, c_int(0), byref(vr1)) # Ch1  ~5/50V
dwf.FDwfAnalogInChannelRangeGet(hdwf, c_int(1), byref(vr2)) # Ch2 ~5/50V
print("Ch1: "+str(vr1.value)+" Ch2: "+str(vr2.value))
# Ch1: 60.70607306692946 Ch2: 60.86322581568005

dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(0), c_double(0.3))  # Ch1
dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(1), c_double(50.0)) # Ch2
dwf.FDwfAnalogInChannelRangeGet(hdwf, c_int(0), byref(vr1)) # Ch1  ~5/50V
dwf.FDwfAnalogInChannelRangeGet(hdwf, c_int(1), byref(vr2)) # Ch2 ~5/50V
print("Ch1: "+str(vr1.value)+" Ch2: "+str(vr2.value))
# Ch1: 5.518196625058977 Ch2: 60.86322581568005

dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(0), c_double(10.0)) # Ch1
dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(1), c_double(0.3))  # Ch2
dwf.FDwfAnalogInChannelRangeGet(hdwf, c_int(0), byref(vr1)) # Ch1  ~5/50V
dwf.FDwfAnalogInChannelRangeGet(hdwf, c_int(1), byref(vr2)) # Ch2 ~5/50V
print("Ch1: "+str(vr1.value)+" Ch2: "+str(vr2.value))
# Ch1: 60.70607306692946 Ch2: 5.536143355938114

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...