VarbanVarbanov

Debugging ACE Module written in C# problem

Discussion created by VarbanVarbanov on Nov 13, 2012
Latest reply on Nov 19, 2012 by inform2prabhat

Hi, there is a turtorial called "vCampus Library_White Papers and Tutorials_PI ACE_Tutorial - Writing a PI ACE Calculation in C Sharp" and the procedure described in it works (as long as the .NET version is 3.5 - I'm telling this for someone who will read this later because it is not mentioned in the document).

But in slightly different situation the debugging is not working and I have two questions, hoping somebody will make a suggestion how to be able to debug the code:

 

1. We have class library that is installed in different location than PIPC folder and the source code is in different place than the class library. In module DB we write all needed configurations including the properties Assembly Path, Source File Location and File Name of an Ace exe module. Assembly Path property is enough to make the module working. When Source File Location (computer name) and File Name (path to the .csproj) file are presenting the "Test" option in the visial studio strats to work! But still debugging is impossible - although the full path to the csproj is specified when trying to debug a window pops up which is saying that it cannot find the file with path specied in the MDB with added .vbproj to the path(check window below). I.e if the path is ..\..\..\projectfile.csproj the window is saying - it cannot find ..\..\..\projectfike.csproj.vbproj file. If you just browse to the .csproj file the message "Unspecified error (Exception from HRESULT: 0x80004005 (E-FAIL)) appears and than "Object refference not set to an instance of an object". No debugging. Any ideas?  

 

 5807.cabtFindFileWindow.png

 

2. I order to try another method for debugging we have made a test console application to call the module methods.We initialize manually the PIACEPoints using :

 

 

 

     EMx = new PIACEPoint(contextName, "EMx", TagAliasUsedType.TagAliasAsInput);

 

     Mx = new PIACEPoint(contextName, "Mx", TagAliasUsedType.TagAliasAsOutput) { SendDataToPI = true };

 

 

 

and than we call ACECalculations(). While all input tags have values during debug when we said in code for example

 

     Mx.Value = Convert.ToDouble(EMx.Value),

 

during debug allways this Mx.Value stays null, although EMx.Value is for example 10. At the same time if we test the module using "test" option - it is working - it is calculating correctly, no null values at the end.  

 

If somebody can explain the reason this is happening and give me any suggestions how to see values during debug, I'll be gratefull.

 

Of course if we find a solution to question 1 quetion 2 will be no more important.

 

Thank you in advance! 

 

 

Outcomes