Posted Thu, 04 May 2023 19:02:33 GMT by castillo, inaki
<br> I have found that function viOpenDefaultRM fails when the calling thread is running as Administrator.<br> The call to the function never returns.&#160;<br> It works fine when the thread runs under a normal user account.<br> Is this intentional&#160; ?&#160;<br> (I am compiling the program with VS2017)<br> <br> &#160;
Posted Sat, 06 May 2023 00:52:24 GMT by Teles, Afonso
Hi Luis,<br> <br> This seems to be an issue with your VISA software. Which VISA are you running?
Posted Sat, 06 May 2023 01:53:43 GMT by castillo, inaki
<p>Tektronix Visa 4.1.1.22</p>
Posted Tue, 09 May 2023 23:16:29 GMT by Teles, Afonso
You could try installing the newer version:<a href="https://www.tek.com/en/support/software/driver/tekvisa-connectivity-software-v420">https://www.tek.com/en/support/software/driver/tekvisa-connectivity-software-v420</a><br> <br> It's hard to tell if that's intentional or not, but I'd suggest trying another VISA software if that functionality is important to you.
Posted Wed, 10 May 2023 00:25:38 GMT by castillo, inaki
<p>Thanks for your feedback, but I have updated to 4.2 and the behavior is exactly the same.&#160;</p>
Posted Wed, 10 May 2023 14:00:46 GMT by Faber, B
Just to check, is this on an oscilloscope, or a PC?&#160; If its a scope, which model?<br> <br> Depending on mode and model, tekvisa speaks through some apps running in the system-tray that speak via shared-memory/pipe through to the scope.&#160; If one side or the other is a different user id, the permissions to access the pipes likely don't match and could cause failures.<br> <br> 'Just a guess at the moment though.&#160; That'd be specific to a specific configuration though.<br> <br> Let us know.&#160; Thanks!<br> Byron<br> &#160;
Posted Wed, 10 May 2023 14:08:05 GMT by castillo, inaki
<p>I am trying to connect to a MDO3054&#160;scope. However, the problem happens before I can access the scope. I mean, the scope can be OFF and the problem still happens.</p> <p>When the call fails I am just opening a VISA session, At this moment I&#160;do not know how many instruments are connected.</p>
Posted Thu, 11 May 2023 18:36:17 GMT by Teles, Afonso
Hi Luis,<br> <br> TekVISA is only meant to have one instance running at a time. I wonder if when you try to run it as admin there's already a non-admin instance running, so it doesn't allow you to open a new instance as admin? You could try logging out of your non-admin account and logging only into the admin account to see if that solves it.<br> <br> Another possibility is that the admin install isn't working properly. I would suggest uninstalling TekVISA entirely and installing it only in the admin account.
Posted Thu, 11 May 2023 19:33:12 GMT by castillo, inaki
When I say 'administrator' account I mean i raise the current user to run as administrator. I am not changing the user, so the profile is the same.<br> I do not have other Visa sessions running. I can repeat the test under the same user, not raised to Administrator, and it works as expected.&#160;<br> <br> It is weird i did not detect this problem before, because I use my user raised to Administrator all the time. It might be related to some update somewhere... Also, in the past I used a NI Visa library. Dont know if it can be related to the problem. I can see parts of NI software still installed.&#160;
Posted Thu, 11 May 2023 20:27:13 GMT by Teles, Afonso
<p>Hi Luis,</p> <p></p> <p>I am no expert on Windows (I'm much more familiar with the UNIX/Linux user system), but I don't believe it's possible to &quot;raise a user to administrator&quot;. Instead what's going on when you &quot;run as administrator&quot; is that both your regular user account and your admin account are logged in at the same time. My suggestion is to log off all users and then login only to the admin account and attempting to run it from there.</p> <p></p> <p>NI VISA and TekVISA have been known to not work well together in the past, so I would suggest uninstalling them both and installing TekVISA again.</p>
Posted Thu, 11 May 2023 21:34:12 GMT by castillo, inaki
<p>These are different things. You can be an user that belongs to Administrators group, and you can still be running below the &quot;administrator&quot; level. If you have access to a Windows machine, right click on any program on your desktop and chose &quot;run as administrator&quot;. This does not change your user at all (you can see there is no logon involved). This extra level is made so that an user, even belonging to Administrators group, can be restricted in some actions that can change system configuration.&#160;</p> <p>Some programs avoid running as administrator because that level allows to access resources that are forbidden to normal programs and can be used to reverse engineer a program. Thats why i asked on my post about the possibility for this behavior to be intentional by Tektronix. &#160;In case you wonder why i want to run my program as administrator it is because some performance analysis tools need this level to work.</p> <p>The NI stuff is possibly having some influence. I will try to clean it.</p>
Posted Thu, 11 May 2023 22:04:41 GMT by Teles, Afonso
Hi Luis,<br> <br> What you're referring there would be called privilege escalation, which is possible, but not what happens when you hit &quot;run as administrator&quot;, as far as I know. This can be easily confirmed by looking at the username for the task under the Details in the Windows Task Manager.<br> On my Windows work system, &quot;run as administrator&quot; runs the task under an admin user, not the regular user with escalated privileges.
Posted Fri, 12 May 2023 13:47:08 GMT by Faber, B
Following back up from my side.. the single thing I can think to suggest is to check if you've got a Tektronix Resource Manager running in your app tray.. (I believe thats the name, as opposed to VXI11 Server, which is only visible on some-oscillscopes directly).&#160; &#160;If you need to run an app as admin, linking into tekvisa, you may find you need to launch that resource manager as administrator as well.<br> <br> (I'm assuming you're running as a standard user and right-clicking to run your test app at admin level here).<br> <br> <br> <br> &#160;

You must be signed in to post in this forum.