RIchard Xu

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. RIchard Xu

    Python Pattern generator behavior inconsistent

    Hi @attila, I think I got my script to work with your help, thank you so much! Best, Richard
  2. RIchard Xu

    Python Pattern generator behavior inconsistent

    I can't run your script out of the box. I currently have the latest waveforms(3.9.1) and adept(2.19.2) installed but I can't find a module named dwfconstants (Do I have to download that from somewhere?) and when I pass in the constants by value I get 'FDwfParamSet' is not defined and I'm not sure what that is. If I comment out the FDwfParamSet line, I still don't get a correct waveform. Did I miss some setup? For reference, I use a build tool for my use case, but I wanted to test out your script.
  3. RIchard Xu

    Python Pattern generator behavior inconsistent

    Hi @attila, Thanks for the prompt response! So some things I'm still a little confused about:\ The # 100Hz base clock = 100MHz/100 comment, I saw that the internal clock is 100MHz, but why does setting the divider to internal_clock/100 make the base clock 100Hz instead of 1MHz. I'm measuring the output with the logic analyzer and visually it looks like it's closer to 4Hz but when measuring with another device (which is what I'm using the ad2 to test), I see that it flips from low to high more than 4000 times. Is the logic analyzer resolution not big enough? or is this an aliasing problem? Also when looking at the logic analyzer, it looks like it sometimes starts in the middle of a period. Do I need to set the initial counter with FDwfDigitalOutCounterInitSet to make sure the wave is consistent? Overall, I just want to simulate a square waveform limited from 0V to 3.3V at frequencies from 1Hz to 1kHz. Is this the right method to do so? Best, Richard
  4. Hi, I'm currently trying to produce a digital signal using the waveform sdk, but the measured response isn't the same as the expected behavior. For example my code: phzFreq = ctypes.c_double(0) dwf.FDwfDigitalOutInternalClockInfo(hdwf, ctypes.byref(phzFreq)) dwf.FDwfDigitalOutTypeSet(hdwf, ctypes.c_int(channel), dwfconstants.DwfDigitalOutTypePulse) dwf.FDwfDigitalOutIdleSet(hdwf, ctypes.c_int(channel), DwfDigitalOutIdleLow) dwf.FDwfDigitalOutRunSet(hdwf, ctypes.c_double(run_time)) dwf.FDwfDigitalOutWaitSet(hdwf, ctypes.c_double(0)) dwf.FDwfDigitalOutRepeatSet(hdwf, ctypes.c_double(1)) dwf.FDwfDigitalOutDividerInitSet(hdwf, ctypes.c_int(channel), ctypes.c_int(100)) dwf.FDwfDigitalOutDividerSet(hdwf, ctypes.c_int(100)) dwf.FDwfDigitalOutCounterInitSet(hdwf, ctypes.c_int(channel), ctypes.c_bool(True), ctypes.c_int(0)) dwf.FDwfDigitalOutCounterSet(hdwf, ctypes.c_int(channel), ctypes.c_int(1), ctypes.c_int(1)) dwf.FDwfDigitalOutEnableSet(hdwf, ctypes.c_int(channel), ctypes.c_bool(True)) dwf.FDwfDigitalOutConfigure(hdwf, ctypes.c_bool(enabled)) from what I understand this should generate a 50Hz waveform with a 50% duty cycle, but it doesn't. Am I missing something?