• 0

Question

Hello Digilent Forums,

I am trying to write a Python script for the impedance analyzer.  I am reading the WaveForms SDK and following examples.

I noticed all methods in the examples that use the dwf (Ex: `dwf.FDwfDeviceOpen`) use positional arguments.

In the SDK, it lists the parameter names/types for the method (Ex: `FDwfDeviceOpen(int idxDevice, HDWF *phdwf)`).

I have tried and failed to figure out how to specify them using keyword arguments instead.  Is it possible?

Thank you in advance for your help!

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

Hi @attila,

Thank you for getting back to me.  I ended up writing 1:1 wrapper functions on the API methods I use that look something like this.

def FDwfDeviceClose(hdwf: c_int) -> int:
    """Close the handle for a given device.

    Args:
        hdwf: (c_int) dwf handle

    Returns:
        int: 1 if successful, 0 if unsuccessful

    """
    return dwf.FDwfDeviceClose(hdwf)

Note: `dwf` is a global variable in this case.

Cheers to AD2!

Edited by jamesbraza
Added info on dwf variable

Share this post


Link to post
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