Test and Measurement Forum

ps4000 library seems to require Admin rights

Post your .Net discussions here

ps4000 library seems to require Admin rights

Postby nconrad » Thu Feb 15, 2018 2:59 am

Hi,

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.

Thanks,

Nathan
nconrad
Newbie
 
Posts: 0
Joined: Sun Jan 21, 2018 8:24 pm

Re: ps4000 library seems to require Admin rights

Postby Hitesh » Thu Feb 15, 2018 9:34 am

Hi Nathan,

Is your Windows operating system up to date with all updates and patches?

What are your UAC settings set to?

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2715
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: ps4000 library seems to require Admin rights

Postby nconrad » Thu Feb 15, 2018 11:05 pm

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.

-Nathan
nconrad
Newbie
 
Posts: 0
Joined: Sun Jan 21, 2018 8:24 pm

Re: ps4000 library seems to require Admin rights

Postby Hitesh » Fri Feb 16, 2018 9:15 am

Hi Nathan,

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?

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2715
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: ps4000 library seems to require Admin rights

Postby nconrad » Thu Feb 22, 2018 3:20 am

Hitesh wrote:Hi Nathan,
Did you use administrator privileges to install the PicoSDK?


I was logged into my user account, but ran the program as Administrator (so it did have admin rights).

Anyway, it's resolved now. I'll write instructions to log out after installing the SDK in the install instructions for the software I'm working on.

-Nathan
nconrad
Newbie
 
Posts: 0
Joined: Sun Jan 21, 2018 8:24 pm

Re: ps4000 library seems to require Admin rights

Postby June Liu » Mon Apr 23, 2018 8:25 am

Hi, Nathan

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.

thanks,
June Liu
June Liu
Newbie
 
Posts: 0
Joined: Thu Apr 12, 2018 1:27 pm

Re: ps4000 library seems to require Admin rights

Postby Martyn » Mon Apr 23, 2018 1:31 pm

Which device do you have, and what O/S are you using ?

Have you downloaded and installed the SDK from our Download Page and are you trying to use the examples from our GitHub Page
Martyn
Technical Support Manager
Martyn
Site Admin
Site Admin
 
Posts: 3043
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 0 guests