Jump to content

Andras

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by Andras

  1. Szia @attila, Thank you, it works now! Just for the record: I incorrectly installed the 32-bit packages (digilent.adept.runtime_2.27.9-armhf.deb and digilent.waveforms_beta_3.20.13_armhf.deb) to my 64-bit Raspberry OS. WaveForms worked, but DWF didn't. To fix this I first needed to remove those two packages: sudo dpkg --remove digilent.waveforms:armhf sudo dpkg --remove digilent.adept.runtime:armhf And then - as you suggested - I installed the digilent.adept.runtime_2.27.9-arm64.deb and digilent.waveforms_beta_3.20.13_arm64.deb packages, and DWF came alive! Thank you! Andras
  2. I'm trying to run a .NET application on Raspberry Pi 4 using the DWF library. It runs on Windows and I could make it work in Raspberry OS before (I just can't remember exactly how 🙈). It's a fresh installation, so first I installed the Adept Runtime (digilent.adept.runtime_2.27.9-armhf.deb) and WaveForms (digilent.waveforms_beta_3.20.13_armhf.deb) without any issues, and WaveForms sees the AD3 correctly. When I run my app and I call the FDwfGetVersion method, and I get this exception: Failed to get DWF version. System.DllNotFoundException: Unable to load shared library 'dwf' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: /home/pi/Work/bbd-p08-body-monitor/Source/BBD.BodyMonitor.API/bin/Debug/net7.0/runtimes/linux-arm64/native/dwf.so: cannot open shared object file: No such file or directory /opt/dotnet/shared/Microsoft.NETCore.App/7.0.7/dwf.so: cannot open shared object file: No such file or directory /home/pi/Work/bbd-p08-body-monitor/Source/BBD.BodyMonitor.API/bin/Debug/net7.0/dwf.so: cannot open shared object file: No such file or directory /home/pi/Work/bbd-p08-body-monitor/Source/BBD.BodyMonitor.API/bin/Debug/net7.0/runtimes/linux-arm64/native/libdwf.so: cannot open shared object file: No such file or directory /opt/dotnet/shared/Microsoft.NETCore.App/7.0.7/libdwf.so: cannot open shared object file: No such file or directory /home/pi/Work/bbd-p08-body-monitor/Source/BBD.BodyMonitor.API/bin/Debug/net7.0/libdwf.so: cannot open shared object file: No such file or directory libdwf.so: wrong ELF class: ELFCLASS32 /home/pi/Work/bbd-p08-body-monitor/Source/BBD.BodyMonitor.API/bin/Debug/net7.0/runtimes/linux-arm64/native/dwf: cannot open shared object file: No such file or directory /opt/dotnet/shared/Microsoft.NETCore.App/7.0.7/dwf: cannot open shared object file: No such file or directory /home/pi/Work/bbd-p08-body-monitor/Source/BBD.BodyMonitor.API/bin/Debug/net7.0/dwf: cannot open shared object file: No such file or directory /home/pi/Work/bbd-p08-body-monitor/Source/BBD.BodyMonitor.API/bin/Debug/net7.0/runtimes/linux-arm64/native/libdwf: cannot open shared object file: No such file or directory /opt/dotnet/shared/Microsoft.NETCore.App/7.0.7/libdwf: cannot open shared object file: No such file or directory /home/pi/Work/bbd-p08-body-monitor/Source/BBD.BodyMonitor.API/bin/Debug/net7.0/libdwf It looks for dwf and libdwf files. I have a libdwf.so in /usr/lib which is a link to libdwf.so.3.20.13 in the same folder. I tried to copy the file into my app's folder, but no luck. I suspect that the library can't be loaded for some reason. Is armhf the right architecture for the 64-bit Raspbian OS? Does WaveForms use this library to connect with AD3? (Because then I can rule out the architecture issue.) Should this work or am I missing something?
  3. Alright, that was it! I added a few more lines to make sure that we always have a big enough buffer. if (cAvailable > voltData.Length) { _logger.LogWarning($"The data available on the device is more than our local buffer size ({cAvailable} > {voltData.Length}), so we double the size of the buffer."); voltData = new double[voltData.Length * 2]; } Thank you @attila!
  4. Szia @attila Yes, I think I have the proper array size, but could you take a look? _ = dwf.FDwfAnalogInBufferSizeInfo(dwfHandle, out int bufferSizeMinimum, out int bufferSizeMaximum); bufferSize = Math.Min(bufferSizeMaximum, (int)acquisitionSamplerate); logger.LogTrace($"Device buffer size range: {bufferSizeMinimum:N0} - {bufferSizeMaximum:N0} samples, set to {bufferSize:N0}."); voltData = new double[bufferSize]; This means that voltData is a 32768-sized double array when I open AD3 with the second configuration. Then later I call FDwfAnalogInStatusRecord to get the number of samples available and I call FDwfAnalogInStatusData to get them. _ = dwf.FDwfAnalogInStatusRecord(dwfHandle, out int cAvailable, out int cLost, out int cCorrupted); ... _ = dwf.FDwfAnalogInStatusData(dwfHandle, 0, voltData, cAvailable); But as you mentioned the shared scope buffer, I realized that it might be possible to have a situation when cAvailable > bufferSizeMaximum with AD3? I'll test this and get back to you! Thank you for the details!
  5. I started testing the new AD3, and I got access violation errors when I tried to start a data acquisition at 1000k samples per second. I don't get this error when I do it at 500k SPS with AD3 or at 1000k with AD2. Running AD3 at 1000k SPS: In my data acquisition loop I call the FDwfAnalogInStatusRecord and FDwfAnalogInStatusData methods. The access violation happens at the FDwfAnalogInStatusData call. Interestingly if I change the sampling rate to 500k SPS then the acquisition works fine. AD2 can handle 500k SPS without any problem, and although at 1000k SPS I start losing some data, it never causes access violation. Running AD2 at 1000k SPS: Both devices are opened with their second configuration, so with 16k scope buffer for AD2 and 32k scope buffer for AD3.
  6. This topic has ~2200 views, but no discussion since 2014. Could you unpin it, so we don't click on it expecting something useful? Thank you!
  7. Szia @attila, Thanks for the tip, I'll check that SDK sample out! I made a few small modifications to my code yesterday, including the removal of the Thread.Sleep and now I could go up to 500 kSPS without any major issues, and I had a 8-hour long recording session at 250 kSPS with only ~25 packet losses, which I think is acceptable. Thank you again for your input!
  8. Szia @attila! Thank you for the explanation! I would need your help. I have been writing my own C# tool to control my AD2 and capture data from its scope. It got better over the past months, but I still occasionally get corrupted data even at reasonably low rates, typically at 250kSPS. It looks like WaveForms has no trouble at all even at higher rates. Here is below how my data acquisition loop looks like, could you take a quick look? I use DWF v3.18.55, the loop thread runs with the highest priority, and I use AD2 with the 2x 16 Ki scope setting. The samplesBuffer is a shifting buffer implementation. int i = 0; while (!terminateAcquisition) { while (true) { i++; if (i % 100 == 0) { if (availableBytes != totalBytes) { logger.LogWarning($"Data acquisition device reported some errors! Good: {(availableBytes / totalBytes).ToString("0.0%").PadLeft(6)} | Corrupted: {(corruptedBytes / totalBytes).ToString("0.0%").PadLeft(6)} | Lost: {(lostBytes / totalBytes).ToString("0.0%").PadLeft(6)}"); } totalBytes = 0; availableBytes = 0; corruptedBytes = 0; lostBytes = 0; } Thread.Sleep(5); dwf.FDwfAnalogInStatus(dwfHandle, 1, out byte sts); if (!((samplesBuffer.TotalWrites == 0) && ((sts == dwf.DwfStateConfig) || (sts == dwf.DwfStatePrefill) || (sts == dwf.DwfStateArmed)))) break; logger.LogWarning($"Data acquisition device got into an unusual state! sts:{sts}"); Thread.Sleep(500); } dwf.FDwfAnalogInStatusRecord(dwfHandle, out int cAvailable, out int cLost, out int cCorrupted); if (cAvailable == 0) { logger.LogWarning($"Aqusition error! cAvailable: {cAvailable:N0}"); Thread.Sleep(500); logger.LogTrace($"Reseting device..."); dwfHandle = ResetDevice(); bufferError = false; samplesBuffer.Clear(); continue; } int cTotal = cAvailable + cLost + cCorrupted; if ((cLost > 0) || (cCorrupted > 0)) { bufferError = true; } totalBytes += cTotal; availableBytes += cAvailable; lostBytes += cLost; corruptedBytes += cCorrupted; dwf.FDwfAnalogInStatusData(dwfHandle, 0, voltData, cAvailable); // get CH1 data chunk if (bufferError) { samplesBuffer.Error(cAvailable, cLost, cCorrupted, (int)cTotal); bufferError = false; continue; } double[] voltDataAvailable = new double[cAvailable]; Array.Copy(voltData, voltDataAvailable, Math.Min(cAvailable, voltData.Length)); samplesBuffer.Write(Array.ConvertAll<double, float>(voltDataAvailable, v => (float)v)); } If you don't mind sharing, I would be very interested in your data recording loop in WaveForms. Does it use DWF as well to communicate with the device? Thank you, Andras
  9. Szia @attila, I just wanted to share the news that I could make AD2 work with Android. Kind of :) I connected AD2 to my Android 10 phone by using an OTG cable. I installed VirtualHere USB Server on my phone and the VirtualHere USB Client on my Windows 11. After some basic configuration I could see my AD2 as "Digilent USB Device" on my Windows machine while it was connected to my phone only. I selected "Use this device", I opened WaveForms and I was able to start the Scope. VirtualHere USB Server costs $25, but it's probably worth it for someone who needs the extra mobility.
  10. Szia @attila, When you say "support network devices" do you mean something like a USB emulation over IP solution for AD2 on Android, or you mean another Digilent/NI device that supports network connection natively and works with Android out of the box?
  11. Hi @attila, I know it's kind of an old question, but I wonder, do you still think that Android support for Analog Discovery 2 is not going to happen? I have Android 10 at the moment, but I know that Android 13 is coming soon. Is the USB device driver problem still an issue? Even if the WaveForms software would not run, could the DWF SDK libraries theoretically work if the USB driver works fine on newer Androids? I ask it, because I have a .NET 6 application that uses my AD2 and it could run on Andoid, if DWF would work.
  12. Szia @attila, Thank you for your explanation, I definitely learned something again! :) I didn't know about the window function, but it makes perfect sense now!
  13. Alright, thank you! I'm just curious: is this an expected behavior? Do I understand it correctly that the screen mode would mean that the source of the FFT are the samples that are currently visible on the screen? If so, and you look at the video I attached, why is this hump in FFT only there at a certain point? The array of samples look continuous on the screen after the first round-trip.
  14. I use WaveForms 3.17.18 on Windows 11 with Analog Discovery 2. The wave generator output (W2) is directly connected to scope input CH1. W2 is set to 123.4567 Hz Sine wave with 500 mV amplitude. I set the Scope to 1kHz and its rage to 200mV/div. I use the built-in FFT in the range of 120 - 130 Hz with the Peak(V) setting. It normally looks good but periodically I get a strange reading like this: I'm not sure what is happening here, could you help me find out? I also made a screencap of this and uploaded here: https://drive.google.com/file/d/1Bxn0S0H6SM2J9r3cXOgJ3lleH5cPN6v7/view?usp=sharing
  15. I got this error after running c:\Program Files (x86)\Digilent\WaveFormsSDK\samples\py\Enumerate.py.
  16. Excellent, we got a little closer! After installing the "CDM v2.12.32 Beta for ARM64" FTDI drivers, Device Manager looks much better: Unfortunately though WaveForms still doesn't find my AD2:
  17. Szia @attila Sorry for the late reply, somehow I didn't get e-mail about your message. I think I found that setting here in the forum now and changed it :) So, regarding the USB emulation thing, can I do some testing with it to prove or disprove if that's the case? Other USB devices seem to be working fine, including a boot pen drive and an external USB 3.0 SSD that I use intensively. As far as I know Bluetooth and wifi are not working on the ARM version of Windows 11, but other basic services should be fine. This is the Device Manager on my x64 Windows 11 (this one is working as expected) And this is the one on ARM Windows 11 (not working properly)
  18. Szia @attila, Thank you for the links, I ended up installing the Visual C++ Redistributable from here: https://aka.ms/vs/17/release/vc_redist.arm64.exe I could past the error message that I had before, but WaveForms doesn't seems to find my Analog Discovery, I get the "No device detected" error. I tried different USB ports and I also tried to add extra power to the AD2 with a USB split cable, but it seems to be not the problem.
  19. I have just installed Windows 11 ARM64 on my Raspberry Pi 4. It works great, but WaveForms seems to be not able to start. After a successful installation I tried to run WaveForms beta v3.17.17 64-bit, and I got the following error: "The code execution cannot proceed because VCRUNTIME140.dll was not found. Reinstalling the program may fix this problem." Can I do something differently or is ARM64 Windows simply not supported (yet)?
  20. Hi @Chuankun, I had a similar problem. I have just bought and updated a Raspberry Pi 4 B and installed Adept Runtime 2.21.2, Adept Utilities 2.4.1 and Waveforms 3.14.3 without any issues. When I run Waveforms from the applications menu its Device Manager doesn't see my AD2, despite it's connected to one of the USB 3.0 ports. I tried both lsusb and sudo lsusb, and there was a difference, the latter showed more devices, so I also tried to run Waveforms from the command line sudo /usr/bin/waveforms, and it started to work! (I probably made a mistake when I installed the Digilent packages as root, and not as the user pi.)
  21. Thanks @attila for the tips! I would like to ask for your help: what would you do if you wanted to measure two (fluid) samples at the same time over and over? For my current experiments I would need to measure the capacitance of one sample and another sample as a control. I'm willing to build a small hardware if I need to, but I really would like to use AD2 and WaveForms to make it happen. Plan A is that I start up two WaveForm instances, one with AD2 and one with the Sound Card option, and I would create a small extension (with fixed resistance) to my soundcard following the diagram you showed me, and I would measure the impedance with both at the same time. Plan B would be that I build/buy a small digitally controlled switch (a small multiplexer basically) for the Impedance Analyzer, have the two probes on its inputs, and control the whole process with a WaveForms script (select the probe, make a measurement, select the other probe, make a measurement, repeat). What do you think?
  22. Thanks @attila, that's good to know! I might use my PC soundcard as a signal generator, it looks an easier workaround for now
  23. @attila That's pretty cool! Also, I'm not sure if this was there in the previous versions, but I really like the "Pick screen color" function, because I like to use RGB gradient tool (http://www.perbang.dk/rgbgradient/) to get my gradient colors. ? Anyway, I have a question relating to my next phase of my experiments: is it possible to use the BNC Adapter with the Impedance Analyzer? I would need to stimulate something with a signal generator while doing the capacitance tests over and over. As I quickly tested it, the Impedance Analyzer module seems to be not working if it's attached to the BNC module (which is attached to the AD2). Thank you!
  24. Hi guys, Today I created a mixture with tap water and glucose just as before. I made a short (3.3 minute-long) and a long (2.7 hour-long) experiment. I made a test with water + glucose mixture and then I did the test once again after I put the baker's yeast into the mix. I focused on both the impedance and capacitance values. Here are the results for the short test: The blue is the tap water for reference. The two reds are the water + glucose combination. I made the two measurements approximately 60 minutes apart, but I also made sure that they have the exactly same amount of glucose in them. I'm not 100% sure why the values are so different. The yellow/green are the baker's yeast mixtures having approximately the same amount of yeast put into the water+glucose mix I used in the previous tests. They showed a nice pattern, so I thought I repeat the experiment, and I let the yeast work for more time. So this is the result of the long test: Blue is tap water for reference. Orange is the baker's yeast. As you can see both the impedance and the capacitance show the activation of the yeast beautifully. I will probably use capacitance for my future tests, because that looks more persistent. @Cleber Borges, thanks, I will probably put together a summary of these when I'm finished with them on my blog (blog.biobalancedetector.com). I hope people will find this forum too @attila, thank you for the improvement! I noticed one more thing: if I use the Impedance Analyzer as you described (Start=Stop) and I generate a chart in the time-domain, the x-axis is not labeled. Could you add labels on it, so that we could see how much time elapsed during the measurements? The other thing is probably connected to this: the Vertical Quick Measurement tool seems to be not working in this mode, it doesn't move from the first column of the chart.
  25. Cool stuff @attila! Thanks, I will definitely try it tomorrow!
×
×
  • Create New...