06-11-2015 02:30 PM
I'm trying to use .NET in LV 2013 on W7-64bit to monitor things like the CPU and RAM usage. I found some examples on the forums which were great help. I've got my program running, and it works on two different machines. However, when I move it to a third machine (all three are Dell laptops), it throws error 1172. (I've saved the error messages as the defaults on the attached VI.)
The attached VI is trivial: It merely tries to load the constructor for two different performance monitors. This example works fine on the first two laptops and gives the error on the third. We checked that the third laptop has the exact same version of .NET as the other two (4.5.2), and applied all Windows updates. Does anyone have any ideas on how to track this down further?
Thanks,
DaveT
Solved! Go to Solution.
06-11-2015 11:32 PM
The error indicates an issue with the registry around the performance counters. I would check that you can monitor the counters you are looking for normally in the Performance Monitor application.
06-16-2015 02:41 PM
In this most basic example that Dave wrote, we are trying to access total %cpu... as you can see in the attaced jpg... It works fine from Perfmon on the computer in question... but the VI still throws the 1172 error.
06-16-2015 03:26 PM
Just to be clear, flipper66 and I are working on the same system, so his observation that the perfom works but the .NET VI doesn't is specifically in reference to the troubled systetm.
Despite his observation, it would still seem likely that there is some issue with the target computer and how certain .NET things are installed. Is there a way to re-initialize or re-install the relevant NET components on that computer?
DaveT
06-16-2015 04:31 PM
A few more observations:
When we start Performance Monitor on the troublesome computer, it pops up a warning:
"Unabel to add these counters:
\Memory\Availalble MBytes
\Memory\% Committed Bytes In Use
\Memory\Cache Faults/sec
\Memory\Cache Faults/sec
\PhysicalDisk(*)\% Idle Time
\PhysicalDisk(*)\Avg. Disk Queue Length
\Network Interface(*)\Bytes Total/sec"
However, as Phil mentioned, some counters DO work in Performance Monitor on that computer, but throw the error with the LV test VI. And the same counters work fine with the LV test VI on another computer.
This seems to be looking more and more like a Windows issue, not LV, but if anyone has ideas about how to clean up the .NET on the target computer, that would be great information.
Thanks,
Dave
06-16-2015 05:28 PM
We found a link on MS's website that describes how to rebuild the performance counters. That seems to have helped.
06-16-2015 05:30 PM
@tyk007 Thanks for pointing us to the registry...
Your comment in combination with the Error message Dave posted about the error on Perfmon startup (which I somehow misssed) led us to the solution. Basically we had to manually rebuild the Performance Coutner Library Values using the info here: