Jump to content
  • 0

Setting power supply limit with WaveForms SDK


rtorsvik

Question

Hello! I am developing a board for the AD3, and I want to utilize its positive and negative power supply to provide +5V and -5V for an op-amp. This works mostly fine, but in some cases, my board loses power, and I suspect it is due to the AD3 limiting its output. Is there some way I can adjust the power limit using the SDK, just as I can adjust the power limit with the WaveForms application?

image.thumb.png.7ef2e8f730de7d6b94dc5fe2b6b7d245.png

This is how I activate the power supplies today.

def activate_supply(self, master_state=1, positive_state=1, negative_state=1, positive_voltage=5, negative_voltage=-5):
        """
            turn the power supplies on/off
            parameters: - device data
                        - master switch - True = on, False = off
                        - positive supply switch - True = on, False = off
                        - negative supply switch - True = on, False = off
                        - positive supply voltage in Volts
                        - negative supply voltage in Volts
        """
        log("Activating power supplies...", "info")

        # set positive voltage
        positive_voltage = max(0, min(5, positive_voltage))
        dwf.FDwfAnalogIOChannelNodeSet(self.device, ctypes.c_int(0), ctypes.c_int(1), ctypes.c_double(positive_voltage))
    
        # set negative voltage
        negative_voltage = max(-5, min(0, negative_voltage))
        dwf.FDwfAnalogIOChannelNodeSet(self.device, ctypes.c_int(1), ctypes.c_int(1), ctypes.c_double(negative_voltage))
    
        # enable/disable the positive supply
        dwf.FDwfAnalogIOChannelNodeSet(self.device, ctypes.c_int(0), ctypes.c_int(0), ctypes.c_int(positive_state))
    
        # enable the negative supply
        dwf.FDwfAnalogIOChannelNodeSet(self.device, ctypes.c_int(1), ctypes.c_int(0), ctypes.c_int(negative_state))
    
        # start/stop the supplies - master switch
        dwf.FDwfAnalogIOEnableSet(self.device, ctypes.c_int(master_state))

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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...