I'm trying to automate some testing with the PicoVNA 106. I'm installed the software from the thumb drive that came with the VNA. I can control VNA from Pico's software and I'm trying to use the DLL to control the VNA from a C# application.
I've successfully loaded the DLL and I can find the SN of the VNA using the FND() command. Following the flowchart on page 4 of the programmer's guide, I tried using SelectKit() and the other commands to initialize the VNA, but I kept on getting a "Path not found" error.
- What path is the SelectKit() method looking for? And how do I set that path from my C# app?
I tried doing a workaround by using the PicoVNA2 to calibrate the VNA, save that calibration to a file, and then use the LoadCal() method in my C# application to apply the cal file to the VNA. I was able to get it to work successfully once or twice, moved onto developing another part of the application, but now it's not working anymore. The LoadCal() method is just returning "Error."
- Why can I load a cal file into the PicoVNA2 that Pico supplies, but get an error when I try to use the LoadCal() method in my C# app?
Yes, I can load the example from Github and everything works fine. That's why I'm asking what the differences are.
I noticed that in your Github example, your project has an Interop.PicoControl2 reference that my project doesn't have. I was under the impression that all I needed to do was reference the PicoControl2.dll and I would up and running.
Sorry if that's a dumb question. I'm a hardware engineer trying to code this application and don't have a lot of experience with higher level software languages.
Yeah, I've tried the example code in github and it works just fine. But when I try using the DLL in my own application, I get "Error" as the response whenever trying to apply a calibration file - which was created with the PicoVNA2 software. And I can apply the same calibration file with your example code.
I sent an e-mail to the address you mentioned with my code and the calibration file. It's probably something really simple.
I just tried merging some of my functions in your example code. I removed all your buttons and data plots in order to add the interfaces needed for my application. I called the exact same functions in the same way with the samer variables that you were calling in your button click events and I still got an "Error" response when selecting a calibration file.
No I didn't see a return e-mail. I attached a zip file. I would have thought that would make it through.
I sent another e-mail to the support e-mail address with just a .cs file - if that's what you mean by "just the code." There's only so many ways to call those functions. I'm not sure just seeing the .cs file will be really helpful.
Sorry I haven't had time to try re-sending the entire project to you. Have you ever tried creating a .zip file but changing the extension to .txt so it slips through the filters?
I've been ignoring the "Error" response from the LoadCal() method and continuing to build up my app. My project in Visual Studio is targeting an x86 platform and using the .NET 4.6.1 framework. I'm using Windows 10 to develop the project, but the app will be running on a 64-bit system using Windows 7.
I did a test run of the .exe on the Windows 7 machine this morning, and the LoadCal() method actually returned an "OK" response. So it looks like it might be a Windows 7 vs. Windows 10 issue.