15 Replies Latest reply on Apr 24, 2016 2:56 AM by jslee

    PIPointInvalidException

    larry.mcdonald

      We are seeing "PIPointInvalidException [-12002] Code Not Found in PInt" and "PIPointInvalidException [-11147] Point ID not found in archive".  When looking into the archives using SMT, we can see that there is in fact data in the archive for the tag names.

       

      We know that the PI Tag Attribute "Point Type" has recently been changed from Float32 to Int32 using AFSDK (piPoint.SetAttribute("PointType", PIPointType.Int32);).  Is this the reason for these errors? 

       

      What do these error messages mean and how to resolve them?

       

      What should we expect to see when changing point types?

       

      Is there a recommended procedure for changing point types of existing tags?

        • Re: PIPointInvalidException
          rgilbert

          Hi Larry, are you accessing the PI Point via an AFAttribute or are you retrieving it by PIPoint.FindPIPoint?

          • Re: PIPointInvalidException
            ekuwana

            Hi Larry,

             

            One possibility is that the tags were deleted (e.g. through SMT) and new tags were created with the same name.

             

            Can you check if the point id shown in SMT is the same as that in AFSDK PIPoint object.

              • Re: PIPointInvalidException
                larry.mcdonald

                The PI Point is accessed through an AFAttribute that is associated with an element (it is not a dynamic attribute).

                 

                I know how to check the Point ID in SMT (Point Builder), but I was not able to check the Point ID in AF System explorer -- is this something that can only be done programmatically?

                 

                Yes, it is possible that the tags were deleted through SMT and then our application will recreate them with the same name (now different type).

                 

                Will this be a problem if the tags are just programmatically updated with a new type without deleting the existing types in SMT?

                 

                What is the best approach when needing to change point types on existing PI tags?

                  • Re: PIPointInvalidException
                    rgilbert

                    Hi Larry,

                     

                    If you hold down the Shift key and click the Settings button in the PI System Explorer, you will see a properties dialog. The resolved config string should be in the dialog.

                     

                    You'll probably see something like: \\Server?ServerID\Tag?PointID;

                     

                    Is the Point ID the same as it is in the SMT?

                     

                    3173.Settings.jpg

                     

                     

                     

                    Thanks,

                     

                     

                     

                    Ryan

                      • Re: PIPointInvalidException
                        Marcos Vainer Loeff

                        Hello Larry,

                         

                        I have tried to reproduce your problem unsuccessfully. Here is what I have done:

                         

                        1)     Create a test tag on the PI Server with a snapshot of 10.

                         

                        2)     Create an attribute using PI Point Data Reference, pointing to the just created tag.

                         

                        3)     Delete the test tag

                         

                        4)     Create a new one with the same name (but different pointids).

                         

                        5)     Open PI System Explorer

                         

                        The result was that it worked successfully.

                         

                        I suggest you to create a new attribute, point it to this tag and let us know the results.

                          • Re: PIPointInvalidException

                            Hey Larry, check out this TechSupport article on the topic:

                             

                            http://techsupport.osisoft.com/techsupport/nontemplates/KB/article.aspx?id=1349OSI8

                             

                            Also, in the PI Server System Management Guide there is a matrix of allowable point type changes.

                             

                            Note, changing the type of an existing point is different to deleting a point and then re-creating that point using the same name but with a different point type.

                            • Re: PIPointInvalidException
                              larry.mcdonald

                              I was able to reproduce the error: "PIPointInvalidException [-11147] Point ID not found in archive" by:

                               

                              1. In SMT, create a test tag (MyTestTag).

                               

                              2. In SMT, open the archive editor and add a few values.

                               

                              3. Delete the test tag (PointBuilder)

                               

                              4. Go back to archive editor and refresh the values. Error occurs.

                               

                              5. Even after recreating the tag, the archive editor will throw the above error until the tag is searched for again.

                               

                              I tried a similar test using AF System explorer:

                               

                              1. Create an element. Create an attribute using PI Point to MyTestTag.

                               

                              2. Check the PI Point ID using the method shown by Ryan.  \\MyServer?fa50f33b-e149-419e-aa35-48e68bda93af\MyTestTag?8826

                               

                              3. Delete the test tag

                               

                              4. Refresh PI Tag value in AF System explorer.  It fails with "Cannot retrieve PI Point...".  It does not give a specific error code like SMT did.

                               

                              5. After recreating the PI Tag (MyTestTag), when checking the PI Point ID in system explorer, it had updated to the new point id (\\MyServer?fa50f33b-e149-419e-aa35-48e68bda93af\MyTestTag?8827)

                               

                              I was not able to reproduce the "PIPointInvalidException [-12002] Code Not Found in PInt" error.  Any ideas.

                               

                              My theory so far is that the application was running with cached AF attributes/PI Points when the PI tags were deleted.

                               

                              Is there any reason to think that changing the PI Point "pointtype" attribute would have any issues with these errors?

                                • Re: PIPointInvalidException
                                  ekuwana

                                  Hi Larry,

                                   

                                  The reason you can't reproduce the [-11147] in PSE is because it re-gets the PIPoint. If you want to reproduce it, you can create an AFSDK App that:

                                   

                                  1. gets a PIPoint object (e.g. PIPoint.FindPIPoint),

                                   

                                  2. delete the corresponding Tag (and optionally create one with the same name),

                                   

                                  3. make a data access call through the original PIPoint object, e.g. PIPoint.GetValue

                                   

                                  Note: depending on the underlying PI library versions the clients (PISMT, AFSDK) are built against, you may get [-10553] instead of  [-11147]

                                   

                                  The [-12002] error is most likely due to trying to change PIPoint attribute (e.g. pointtype) when the point has been deleted. You can try to reproduce it through an AFSDK App that:

                                   

                                  1. gets a PIPoint object (e.g. PIPoint.FindPIPoint),

                                   

                                  2. delete the corresponding Tag (and optionally create one with the same name),

                                   

                                  3. change the point attribute of  the original PIPoint object, e.g. PIPoint.SetAttribute then PIPoint.SaveAttributes

                                   

                                  Note: depending on the underlying PI library versions the clients (PISMT, AFSDK) are built against, you may get [-12001] instead of  [-12002]

                                   

                                  So the answer to your last question is normally, changing the PI Point "pointtype" attribute would not have any issues with these errors, unless as shown in the above scenario where the tag corresponding to the PIPoint object has been deleted.

                                    • Re: PIPointInvalidException
                                      moklingfung

                                      As Eddy and Ryan said, AFSDK throws PIPointInvalidException when AFSDK tries to call the PIServer using a PointID corresponding to a tag that has been deleted. Since the PIserver could return different status code for this same error for different data access mehtod, AFSDK returns a common exception (PIPointInvalidException) so that application does not have to keep track of the different status code for different data access methods. For example, -11147 is typically for single point data access method; -12002 or -10553 are normally from pointlist methods.

                                       

                                      Also, AFSDK/PIPoint data reference will automatically try to refresh the point ID using the same tag name in the PIPointDR configuration. So in your test, if you recreate the tag using the same tag name, you will not get the PIPointInvalidException.

                                        • Re: PIPointInvalidException
                                          larry.mcdonald

                                          Thanks for the input from all of you.  I was able to locate where the -12002 error message was coming from.  The PI tag was deleted, but a reference in the AF hierarchy was accessed that had a reference the deleted tag.  It seems that all the issues I encountered were due to deleted PI tags.

                                           

                                          I think this puts to rest my concerns that the changing the PI point type was the issue.  This feature seems to work correctly.

                                            • Re: PIPointInvalidException
                                              larry.mcdonald

                                              Sorry to bring this up again.  Our customer is seeing the -12002 error message, even after new PI tags have been created.  After some debugging (printing out the PI Point IDs for the accessed AFAttribute references), the AF still references the point IDs of deleted PI tags.  What can be done to get rid of these references?  Are the Point IDs for AFAttribute references stored in the PIFD so that name reconciliation no longer works.

                                               

                                              For example, some debug code indicated that the PI Point ID associated with an AFAttribute was 996, however when looking in PI System Management Tools, I was able to find the PI tag (same name) with a point id = 1008.

                                               

                                              Any suggestions on how to resolve this?

                                                • Re: PIPointInvalidException

                                                  Hello Larry,

                                                   

                                                  I've tried reproducing your issue but wasn't able to, even not when changing the PIPoints name such way that a case sensitive comparison would fail (testtag01 -> testTag01).

                                                   

                                                  Generally, I suggest restoring deleted PI points rather than re-creating them. Please check OSIsoft KB 2785OSI8 - How to recover deleted points, or how to restore deleted tags in PI 3.x. One of the advantages is that this also makes historical data available that is "lost" when re-creating a PI Tag.

                                                   

                                                  Error [-12002] translates "Code Not Found in PInt" and means that the given reference wasn't found within the PI Point table or more simple that the PI Point doesn't exist. Are you confident the AF reference points to the correct PI Server?

                                                   

                                                  To get a better understanding of what's causing your issue, I suggest the following:

                                                   

                                                  - Import the AF Element (complete structure) for which you see error [-12002] using AF Builder add-in for Microsoft Excel
                                                  - Save the spreadsheet as "old" configuration
                                                  - Use PI System Explorer and "repair" the broken reference manually by looking up the PI Point.
                                                  - Check in the change
                                                  - Use AF Builder Excel add-in to retrieve the "new" configuration.
                                                  - Compare both configurations

                                                   

                                                   

                                                    • Re: PIPointInvalidException
                                                      Marcos Vainer Loeff

                                                      Hello Larry,

                                                       

                                                      Besides using PI AF Builder, another suggestion would be to export your AF structure to a XML file using PI System Explorer. After creating a new AF database you can import the same structure with the information of the XML file but (hopefully) with the correct configuration of the attributes.  As you will create a new database, not changing anything on your original database, it is worth testing this option.

                                  • Re: PIPointInvalidException
                                    jslee

                                    Hi Larry, you may want to right click the attribute that the AFSDK 3rd party application is pointing to and select "create or update data reference", it should help AF release the previous PIpoint reference and its PointID, and fetch the new PointID of the "same" tag.

                                     

                                    This should do the trick.