gabagool
Members-
Posts
10 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
gabagool's Achievements
Member (2/4)
1
Reputation
-
Device: Analog Discovery 3 Hi, I am wondering how I can increase the total recording time of the `scope` module in the SDK. I am trying to record and plot the output of a component and require a 30 second recording of scope data. Currently the SDK defaults to 0.5s. What I am doing is: def test(device_data): scope.open(device_data) dwf.FDwfAnalogInRecordLengthSet(hdwf, 30) dwf.FDwfAnalogInTriggerPositionSet(hdwf,c_double(-0.01)) # set up triggering on scope channel 1 # scope.trigger(device_data, enable=True, source=scope.trigger_source.analog, channel=1, level=3.3) sleep(1) # wait 1 second # record data with the scopeon channel 1 buffer = scope.record(device_data, channel=1) # limit displayed data size length = len(buffer) if length > 10000: length = 10000 buffer = buffer[0:length] # generate buffer for time moments time = [] for index in range(len(buffer)): time.append(index * 1e03 / scope.data.sampling_frequency) # convert time to ms # Plot settings plt.grid(True) plt.yticks([i * 0.1 for i in range(0, 41)]) plt.ylim(0, 4) plt.xlabel("time [ms]") plt.ylabel("voltage [V]") #Plot Data plt.plot(time, buffer) plt.show() scope.close(device_data) SDK documentation and other forum examples showed the use of `FDwfAnalogInRecordLengthSet`, however this has not changed the time of recording. I also tried increasing the buffer size but no luck and removing the `if length > 10000` buffer check. What have I missed here? I found that setting `scope.trigger` waits until the threshold has been reached to start, but again this just records 0.5s worth of data when I need the full 30s.
-
Waveform SDK for Analog Discovery 3
gabagool replied to Manik Dautta's topic in Suggestions & Feedback
Hi @artvvb, I made some comments about the Analog Discovery 3 SDK compatibility here: -
gabagool reacted to an answer to a question: [BUG] Waveforms 3.21.3 UART Protocol analyser does not work
-
analog discovery 3 Waveforms SDK throwing errors with static supply tests
gabagool replied to gabagool's question in Test and Measurement
Thanks @attila. Are there plans to update the library for the Analog Discovery 3 any time soon? -
analog discovery 3 Waveforms SDK throwing errors with static supply tests
gabagool replied to gabagool's question in Test and Measurement
Loosely related, but is it possible the SDK has not been updated for Analog Discovery 3 devices? I've started to try use the library functions directly, and trying to get the device name with: dwf.FDwfEnum(c_int(0), byref(numDevices)) for iDevice in range(0, numDevices.value): dwf.FDwfEnumDeviceName(c_int(iDevice), devicename) print("Device: " + str(iDevice+1)+" : \t" + str(devicename.value)) returns: Device: 1 : b'Analog Discovery 3' Whereas with the SDK: device_data = device.open() print("Device name: " + device_data.name + "\n") returns and empty: Device name: Following into the open function of device.py I see that the Discovery 3 is not listed in the constants module which seems to come from "import dwfconstants as constants": device_names = [("Analog Discovery", constants.devidDiscovery), ("Analog Discovery 2", constants.devidDiscovery2), ("Analog Discovery Studio", constants.devidDiscovery2), ("Digital Discovery", constants.devidDDiscovery), ("Analog Discovery Pro 3X50", constants.devidADP3X50), ("Analog Discovery Pro 5250", constants.devidADP5250)] -
Hi, I'm trying to write a test application for the Analog Discovery 3 which utilises the DIO channels. From my understanding, the static.py file contains the library functions for this, and also the test_static-supplies.py file exists for testing purposes. When I run the test_static-supplies.py test file, it returns the following once reaching here: # set the state of every DIO channel static.set_state(device_data, index, not(mask & pow(2, index))) and the error: Exception has occurred: TypeError unsupported operand type(s) for &=: 'c_ushort' and 'int' File "C:\Program Files (x86)\Digilent\WaveFormsSDK\inc\WF_SDK\samples\test_static-supplies.py", line 36, in <module> static.set_state(device_data, index, not(mask & pow(2, index))) TypeError: unsupported operand type(s) for &=: 'c_ushort' and 'int' From the library side, it seems to be complaining due to this in the set_state function: # set bit in mask if value == True: mask |= __rotate_left__(1, channel, data.count) else: bits = pow(2, data.count) - 2 mask &= __rotate_left__(bits, channel, data.count) I've tried casting mask to a uint16_t, an int, and an short but still receive the same result (or variations of it complaining about unsupported operand types). Am I doing something wrong here?
-
[BUG] Waveforms 3.21.3 UART Protocol analyser does not work
gabagool replied to gabagool's question in Test and Measurement
Not sure, but you are using a DDiscovery B device. I have just tried this again and it still does not work on my Discovery 3. Also, I don't have the option to change digital voltage on the discovery 3. Again, rolling back fixes this problem. -
[BUG] Waveforms 3.21.3 UART Protocol analyser does not work
gabagool replied to gabagool's question in Test and Measurement
-
[BUG] Waveforms 3.21.3 UART Protocol analyser does not work
gabagool posted a question in Test and Measurement
Hi, Apologies is this is the wrong place to post this - I installed the latest version of Waveforms (3.21.3) and tried to sniff my UART lines on my PCB, however was not able to see any ASCII output in the terminal window. Going to the Logic window and connecting to my DIO line, I can see the UART pulse. I confirmed my UART to be working by using another sniffing tool in the office. A colleague then tried it on his Digilent and we observed the UART to be working. The only major difference being the version. I downgraded my Waveforms to 3.20.1 and ran the Protocol window again and have observed the ASCII outputs in the terminal window. -
artvvb reacted to an answer to a question: How can I include the Waveforms SDK files into my VSCode path?
-
How can I include the Waveforms SDK files into my VSCode path?
gabagool replied to gabagool's question in Test and Measurement
I think I've resolved my issue by following the instructions listed here: https://digilent.com/reference/test-and-measurement/guides/waveforms-sdk-getting-started#:~:text=Installing the Package -
How can I include the Waveforms SDK files into my VSCode path?
gabagool posted a question in Test and Measurement
Hi, I am having a little trouble getting the Waveforms SDK included into my VSCode project. I am trying to write some test scripts with Python and want to include the WF_SDK libraries in my environment so the program compiles and intellisense works properly. I've tried modifying my settings.json file but have had no luck: { "version": 2, "configurations": [ { "name": "cfg1", "includePath": [ "${workspaceFolder}/**", "C:/Program Files (x86)/Digilent/WaveFormsSDK/inc/**" ], // other configuration settings } ], "settings": { // other global settings } }