Jump to content
  • 0

Reading a DC Voltage from CH1


Ostin Flores

Question

Hi,

I am working on a simple application to send and read a DC voltage from The Digilent Discovery 2. I am doing this through a python scrip and my FDwfAnalogOutNodeOffsetSet command works fine but when I feed this output voltage into CH1 Scope I get a small voltage reading (~1mV) regardless of what I send. Below is the code that I am using...

    #Code to open devise....

    HeaterVoltage = c_double()
    dwf.FDwfAnalogOutNodeOffsetSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_double(0.3)) #Sending 0.3V out
    time.sleep(2)
    dwf.FDwfAnalogInChannelOffsetGet(hdwf, c_int(0), byref(HeaterVoltage)) #Reading the Voltage back
    print("Voltage readback: " + str(HeaterVoltage.value))

I am using the Discovery BNC CH1 is my output 0 ohm termination, input is CH1 and I tried both AC and DC coupling. Can you please tell me if I am doing something wrong?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Ostin Flores

The FDwfAnalogInChannelOffset refers to the oscilloscope vertical offset. Use FDwfAnalogInStatusSample for to get a single ADC sample.

See WF SDK/ samples/ py/ AnalogIn_Sample.py

See in WF SDK/ manual.pdf FDwfAnalogInStatus FDwfAnalogInStatusSample 

dwf.FDwfAnalogOutNodeOffsetSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_double(0.3)) #Sending 0.3V out
time.sleep(2)
dwf.FDwfAnalogInStatus(hdwf, c_int(0), None)
dwf.FDwfAnalogInStatusSample(hdwf, c_int(0), byref(HeaterVoltage)) # Ch1
print("Voltage readback: " + str(HeaterVoltage.value))

 

 

Link to comment
Share on other sites

  • 0
On 2/22/2022 at 8:38 AM, attila said:

Hi @Ostin Flores

The FDwfAnalogInChannelOffset refers to the oscilloscope vertical offset. Use FDwfAnalogInStatusSample for to get a single ADC sample.

See WF SDK/ samples/ py/ AnalogIn_Sample.py

See in WF SDK/ manual.pdf FDwfAnalogInStatus FDwfAnalogInStatusSample 

dwf.FDwfAnalogOutNodeOffsetSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_double(0.3)) #Sending 0.3V out
time.sleep(2)
dwf.FDwfAnalogInStatus(hdwf, c_int(0), None)
dwf.FDwfAnalogInStatusSample(hdwf, c_int(0), byref(HeaterVoltage)) # Ch1
print("Voltage readback: " + str(HeaterVoltage.value))

 

 

Great!!! This worked beautifully!!

Thanks for the help :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...