I'm trying to control a ps4262 from C# on a Windows 10 computer. I'm using the 64-bit SDK 10.6.12.41.
When using the ps4000.dll's OpenUnit() function, error 1 "PICO_MAX_UNITS_OPENED" is returned.
However, when I run the program with "Run as Administrator", it is able to control the ps4262.
How do I make my program run without admin rights? It should be possible, as the Picoscope6 application is able to connect without running it with administrator rights.
After posting, I ended up solving my issue (but couldn't immediately edit my question due to the forum's moderation policy).
In this case, I had not logged out and logged back into my account after installing PicoSDK. This caused the SDK's library path to not be in my environment's PATH variable. At the time, I didn't realize that a log-out and log-in (or restart) was required.
In order to link the ps4000.dll with my tool, I had manually copied the ps4000.dll into the same directory as my application. I think that either I would have needed to copy some other DLL, or the system must be setup to automatically elevate privileges when running the DLL in its default path and copying it with my user account removed the auto-elevation from the library.
After logging out (and removing ps4000.dll from my project's output directory), it no longer needed admin rights to run.
The ps4000.dll has a dependency on the picoipp.dll so if you are copying the ps4000.dll to another directory, then we would recommend that the picoipp.dll is copied alongside as well.
The need to log out and log back in again to refresh the PATH environment variable might depend on your User account settings. Did you use administrator privileges to install the PicoSDK?
could you tell me how to log out and log into my count, I have the same trouble with you, and I even got a "PICO_MAX_UNITS_OPENED" under Administrator.