VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with VS 2011 .net assembly

Solved!
Go to solution

Yesterday I was working/developing a LV application that has been working fine for weeks. It uses the VS API for  various operations, such as uploading model parameters, inputs/ outputs, reading the associated values... At the end of the day, as the application was running against a RT target with VS 2011 engine, I shut down Windows by mistake (menu >> shutdown )... which forced all the applications to close... I did not think much of it, until today after resuming work, none of my LV code using VS API works. The code sends out a .net Exception Error 1172 pretty much for all operations... 

 

I attached a simple VI that opens a reference to the Workspace Manager to check the system's current state, as an example... the Open Workspace works, but the Get System Status fails...  Did something got corrupted in the GAC or something else freaky related to .net ? 

 

Thx.

L

 

PS: 

Win7

LV 2011

VS2011

Although the PC has VS 2010 installed. 

0 Kudos
Message 1 of 7
(6,676 Views)

some more details: the previously attached VI generates on my system the following error: 

 

---------------------

Error calling method NationalInstruments.VeriStand.ClientAPI.Factory.GetIWorkspace2, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: NationalInstruments.VeriStand.VeriStandException: Could not connect to the VeriStand server. Make sure you have the correct address to the gateway, the gateway is running, and any firewalls are configured correctly before attempting to connect.
Inner Exception: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at net.pipe://localhost/NI/VeriStand_Gateway/2011/DataServer that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Inner Exception: System.IO.PipeException: The pipe endpoint 'net.pipe://localhost/NI/VeriStand_Gateway/2011/DataServer' could not be found on your local machine. ) <append><b>System.IO.PipeException</b> in NI_VS Workspace ExecutionAPI.lvlib:NI VeriStand - Open Workspace Manager Reference.vi->CheckWorkspace Status.vi

------------

 

and at load time the LV project had the following warnings:

--------------

C:\Program Files\National Instruments\LabVIEW 2011\vi.lib\NI Veristand\Execution\ModelManager\NI VeriStand - Set Multiple Parameter 2D Array Values.vi (NI_VS ModelManager ExecutionAPI.lvlib:NI VeriStand - Set Multiple Parameter 2D Array Values.vi)
- Expected Assembly "NationalInstruments.VeriStand, Version=2010.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308", but found "NationalInstruments.VeriStand, Version=2011.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308."
C:\Program Files\National Instruments\LabVIEW 2011\vi.lib\NI Veristand\Execution\Project\NI VeriStand - Close Workspace Window.vi (NI_VS Project ExecutionAPI.lvlib:NI VeriStand - Close Workspace Window.vi)
- Expected Assembly "NationalInstruments.VeriStand, Version=2010.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308", but found "NationalInstruments.VeriStand, Version=2011.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308."
C:\Program Files\National Instruments\LabVIEW 2011\vi.lib\NI Veristand\Execution\Project\NI VeriStand - Open Workspace Tool.vi (NI_VS Project ExecutionAPI.lvlib:NI VeriStand - Open Workspace Tool.vi)
- Expected Assembly "NationalInstruments.VeriStand, Version=2010.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308", but found "NationalInstruments.VeriStand, Version=2011.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308."
C:\Program Files\National Instruments\LabVIEW 2011\vi.lib\NI Veristand\Execution\Workspace\NI VeriStand - Set Multiple Channel 2D Array Values.vi (NI_VS Workspace ExecutionAPI.lvlib:NI VeriStand - Set Multiple Channel 2D Array Values.vi)
- Expected Assembly "NationalInstruments.VeriStand, Version=2010.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308", but found "NationalInstruments.VeriStand, Version=2011.0.0.0, Culture=neutral, PublicKeyToken=a6d690c380daa308."

-----------------

 

Smiley Frustrated

 

L.

 

PS: On a separate system, the same code works fine, as it used to be before the initial event (windows shut down) as described in previous post

 

0 Kudos
Message 2 of 7
(6,670 Views)

Hmm, this is error is usually thrown when an instance of NIVS is not running. Do you have a VeriStand instance running on the same PC while the VI is executed? Note that this is required whenever the Execution API is used.

 

If NIVS is in fact running, do you face any issues connecting/deploying to the target from VeriStand's Project Explorer?

Nestor
0 Kudos
Message 3 of 7
(6,666 Views)
Solution
Accepted by LDBM

I uninstalled VS 2010, and the VI I attached is now working again. It looks like some VIs were using VS2010's assemblies in my code instead of VS 2011...  Not having VS2010 anymore seems to create some broken VIs.  I now will try to repoint these onto VS 2011 assemblies.

 

L.

0 Kudos
Message 4 of 7
(6,660 Views)

That's it. It seems fixed... now after repointing to VS 2011 assemblies... 

L.

0 Kudos
Message 5 of 7
(6,656 Views)

hmmmm...sounds similar to the issue addressed in this KnowledgeBase where LabVIEW links to the wrong version of the .NET Assembly. To prevent LabVIEW from loading the wrong version of the assembly, follow the instructions in the article.

Message 6 of 7
(6,653 Views)

It does look like a very similar issue...! 

L

0 Kudos
Message 7 of 7
(6,648 Views)