LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET error 1172 in LV

Solved!
Go to solution

    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

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 1 of 7
(4,155 Views)

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.

0 Kudos
Message 2 of 7
(4,126 Views)

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.  

 

PerfMonCapture.jpg

0 Kudos
Message 3 of 7
(4,075 Views)

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

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 4 of 7
(4,060 Views)

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

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 5 of 7
(4,047 Views)
Solution
Accepted by topic author Dave_Thomson

We found a link on MS's website that describes how to rebuild the performance counters.  That seems to have helped.

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 6 of 7
(4,033 Views)

@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:

 

https://support.microsoft.com/en-us/kb/300956/en-us

0 Kudos
Message 7 of 7
(4,029 Views)