• Content Count

  • Joined

  • Last visited

About spri

  • Rank
    Frequent Visitor

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I have been using the AnalogDiscovery2 with a custom python application built with the SDK to provide synchronous control to several lab instruments. I recently discovered that at certain sample rates, my signals aren't actually synchronized. I've stared at the code for two days and can't find my error, so I'm reaching out for help! The Q-clock runs at frequency that is an integer multiple of the X-clock. In most cases, the two clocks remain synchronized indefinitely. However, at some frequencies, the Q-clock starts synchronized but begins to drift with respect to the X-clock, so after a
  2. After spending more time digging around on this, I discovered that this is an issue with residual files in the pycache after a python version update, and has nothing to do with the WaveForms SDK. If anyone else encounters this error, clear the cache and see this post for more details: https://stackoverflow.com/questions/514371/whats-the-bad-magic-number-error>
  3. I just updated Python from version to 3.7.3 (a big jump, I know... but it was time). Now, when I try to run an application I created using the WaveForms SDK, I get the error, from dwfconstants import * ImportError: bad magic number in 'dwfconstants': b'\x03\xf3\r\n' I just updated WaveForms, and the error persists. What does it mean? How do I fix it?
  4. Thank you, that worked perfectly! But, I'm a little confused still as to why my solution didn't work. When using -1 to configure the master run time, does that override individual channel settings on the wait time?
  5. Thanks for that pointer, but I had already tried that - when I replace the AnalogOutWaitSet with these two lines of code, both channels trigger at the same time using whatever delay period is specified for channel 0. Is there some additional argument (node?) which is required to make this work when using the SDK and not the Waveforms software?
  6. I am trying to create two square wave signals on the AD2 Analog instrument. Both signals should start at 5v, one should drop to 0v at the trigger, and the other should go to 0v after a certain delay time after the trigger (delay time = self.d/1000). Both signals should return to 5v at the same time (end of RunSet). I think I have to do this using the 'funcCustom' output, at least for the delayed signal. However, I am not able to get the funcCustom signal to give me the desired output. It just outputs 5v constantly after the trigger signal. (The funcSquare signal does what is expected). I
  7. Thanks @attila. I did not think to use funcSquare to create a DC offset for a specified duration.
  8. I am trying to do something similar, with an idle offset value and then switch to a different DC offset value after a trigger. However, with the code below, I am getting the FuncDC/NodeOffset value immediately when I configure the channel, instead of the idle value prior to the trigger. It only goes to the idle value after the RunSet duration. Could you please explain how to get it to idle at a low value prior to the trigger?
  9. For the analog discovery 2 SDK, when using the AnalogOutWaitSet command, is there a function which will tell me how long until the trigger/device start? I am looking for something similar to AnalogOutRunStatus, but which will tell me the remaining wait time. Thank you.
  10. Thanks, this helps a lot with the pulsed outputs. Is it possible to also do this with the Constant output-type also? For example, in the setup below I want DIO-2 to switch from idle to constant at t=30ms (20ms delay after the 10ms wait-set), but there are obviously not options for the counter-init and divider-init for this output type. I am ultimately interested in doing this within the python sdk, not in waveforms (but waveforms is a good place to start to visualize what I'm doing). In the SDK and dwf.h file it is also not clear how to set the output type to PP+constant or contro
  11. On the Discovery2, is it possible to set a different trigger wait-set (Analog/ DigitalOutWaitSet) for each individual channel index, rather than one trigger delay for the whole instrument?
  12. Apologies for asking dumb questions, but that table is definitely not in the version of the SDK reference manual I have been using. I'm using the May 8 2017 version -- is there an update, or is this from an older version and somehow got cut? My version doesn't even have a section 11.3...
  13. Waveforms allows the user to turn the power supplies on and off, and set the voltage for the Analog Discovery 2. How do you do this with the SDK? Also, what is the default setting? I cannot find anything in the documentation. Thanks!
  14. I am using an external trigger pulse to start outputs on AnalogOut and DigitalOut pins using the python SDK. The Trigger Pins on the AD2 are so sensitive that they interpret slight jostles of the wire as a trigger pulse -- so my outputs start unexpectedly. There are functions to qualify the trigger on AnalogIn (hysterisis, lengthcondition, etc) to wait for the right signal -- how do I do something similar for the Analog and Digital Out Triggers (because they seem to only have SlopeSet functions)? Also, is it possible to have the same external trigger line act as both a 'Start' and 'Sto