Jump to content
  • 0

confused on python interface


erikderuijter

Question

hi, i hope this is not a dumb question.

i have an analog discovery 2, it works well (super happy with it) and also the python scripting works.

however:

if i just do following:

from WF_SDK import device, logic, error # import instruments

device_data = device.open(config=4)

and then in the debugger --after device.open() check this:

device_data.digital.input.max_buffer_size

i get 4k, yet i would expect 16k as that is what the device configuration promises for #4

i'm confused on that, but it get worse (for my confusion)

because then, if i run following script:

try:
    DIO_IN = 0

    # connect to the device
    device_data = device.open(config=4)

    logic.open(device_data, sampling_frequency=1024, buffer_size=16*1024)
    logic.trigger(device_data, enable=True, channel=DIO_IN, rising_edge=True)
    for i in range (1):
        buffer = logic.record(device_data, channel=0)
        buffer1 = logic.record(device_data, channel=1)
        print (len(buffer))

and in the debugger i check the size of buffer, it is indeed 16k

i feed a signal to DIO_IN, however, it is only captured on the first 8k.

i must be missing something, would appreciate to learn what that is.

also: am i right that the process is: you trigger, and then record multiple channel like in my script, or are you supposed somehow to record multiple channels in one record statement to have synchronised data.

sorry if it is a simple mistake. thanks!

 

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

@attila thanks again, it all works now as expected, als got the multiple-channel question figured out. All perfect for my goals.

You mentioned you unfamiliarity with the DWF python wrapper and also that it is not maintained: I checked where I found it, and actually it was a suggestion from the Digilent web site: you can find it on this page under the heading 'Creating Modules', along with some light examples. They look less involved for a newbee when compared to the SDK, this is why I tried it.

Maybe it is a suggestion to remove that section. 

https://digilent.com/reference/test-and-measurement/guides/waveforms-sdk-getting-started?s[]=python

Thanks again - Erik

 

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