12 Replies Latest reply on Oct 11, 2012 6:47 PM by charlie@osisoft.com

    Issue with Snapshot property of ListData in PISDK code (also in SMT)

    vkrejc

      Hi,

       

      First I would like to descibe you our environment.

       

      We have 64bit Windows Server 2008 with 64bit PI Server and PI SDK in 32 bit version.

       

      We have main x86 application using PI SDK and another simple x86 application using PI SDK for testing purpose [TestApp]. Using TestApp we are able to create/delete PIPoints and set them values. Then main application should read these values.

       

      Here is the simple test case:   

       

      1) delete PI Points (through test app)

       

      2) create PI Points (through test app)

       

      2) set values for all of them (through test app)

       

      3) read values for all of them (through main app or SMT)

       

      We have the same issue with SMT and our main app. Let me explain it to you on SMT. SMT WAS RUNNING. Then we deleted, created PI Points and set them values. In SMT we went to current values tab and we saw these points in error state. Error code for every PIPoint said that it is not on the server. After restart of SMT, everything looks fine. We are able to see correct values for all PIPoints. The same behavior occurs with our main app. We must to restart it to received correct values. Otherwise we are receiving that PIPoint is not good and has value from digital set SYSTEM with error that PIPoint is not on the server.

       

      Any suggestions?

       

      Thanks,

       

      Vlad

       

       

       

       

        • Re: Issue with Snapshot property of ListData in PISDK code (also in SMT)
          vkrejc

          Hi, please let me add some additional information. I tried to simulate this behavior also on 32bit PI Server and the same issue.

           

          I received this message in log:

           

          PI-PB> Unable to retrieve point information.  Error -2147220006: The PIPOINT has been deleted on the server

           

          Issue occurs when:

           

          1. delete tags

           

          2. create tags

           

          3. set values

           

          I'm guessing that deleting tags is the problem. Either we delete tags with the wrong way or PI SDK application has problem when it is connected to PI Server and another app deletes, creates and set values on the same PI Server. I should say that when we restart PI SDK application, it reads values fine.

           

          thank you very much for all your suggestions,

           

          Vlad

            • Re: Issue with Snapshot property of ListData in PISDK code (also in SMT)

              Hello Vlad,

               

              Vlad Krejcirik

              PI-PB> Unable to retrieve point information.  Error -2147220006: The PIPOINT has been deleted on the server

               

              Is this message from PI ProcessBook?

               

              If you delete a PI Point and create a new one with the same name, the new point isn't the old one. Point ID's are not recycled. Many applications use the point ID for identification. Besides PI SDK is caching some information.

               

              Please note that creating and deleting PI Points is not just exchanging data with the PI Server.

               

              Can you please describe what the purpose of your application is?

               

              Gregor

                • Re: Issue with Snapshot property of ListData in PISDK code (also in SMT)
                  vkrejc

                  Hi Gregor,

                   

                  No, the error message is from SMT. I'm getting this error when I'm trying to do snapshots.

                   

                  PI SDK is caching some information? What kind of information?

                   

                  I see, that it is not just exchanging data with PI Server. It is our test case. We would do this test case automaticaly every night to test our application.

                   

                  Test case is simple: create test pi tags, set them values and read these new values using our app.

                   

                  Purpose our application is simply read current values and archive values, update values, tracking changes of values PI Points.

                   

                  Simply, when some application using PI SDK is connected to PI Server during this test case, after that it get us this error for given PI Points. After restart works fine. May be it is due to some caching or re-creating PI Points is not very usual operation and PI SDK applications cannot handle it. But I'm just guessing...

                   

                  Thank you very much!

                    • Re: Issue with Snapshot property of ListData in PISDK code (also in SMT)

                      Hello Vlad,

                       

                      Vlad Krejcirik

                      PI SDK is caching some information? What kind of information?

                       

                      Configuration like for PI Points, Digital State Sets and similar.

                       

                      Vlad Krejcirik

                      Test case is simple: create test pi tags, set them values and read these new values using our app.

                       

                      Vlad Krejcirik

                      Simply, when some application using PI SDK is connected to PI Server during this test case, after that it get us this error for given PI Points.

                       

                      How would the other application know of tags that are created while it is running and connected to the PI System?

                       

                      Are you sure your application is not

                       

                      1. deleting PI Points

                       

                      2. creating PI Points

                       

                      3. Add values to new Points

                       

                      4. Read values from new Points

                       

                      What I am still not sure of is what you would like to achieve by creating and deleting tags on a regular base. Do you expect to discover a PI System issue or an issue with your application this way?

                       

                      Gregor

                        • Re: Issue with Snapshot property of ListData in PISDK code (also in SMT)
                          vkrejc

                          Thank Gregor for answer.

                           

                           

                           

                          I'm sorry if I'm missing something. Creating and deleting tags are part of this test case. We need these tags only for this test case.  May be it is not the best choice to create tags and delete tags in every run of test case. May be it will be better to have these tags on Pi Server every time.

                           

                          Purpose of this test case is simple read the same values using our application as we set them using the test application.

                           

                           

                           

                          Gregor Beck

                          How would the other application know of tags that are created while it is running and connected to the PI System?

                          That's good question. We have implemented following workflow:

                           

                           

                           

                          create new PI Tags (we know their names. They started with tst_ prefix) (test app) -> set values to these new PI Tags (test app) -> read values of these new PI Tags (Main app knows their names)

                           

                          During whole test case main application is running and is connected to PI Server.

                           

                          I did several tests to try to understand what we can do and what we don't. I was using SMT for these tests, because it has the same behaviors.

                           

                          1) SMT is connected and PI Server doesn't contain test PI Tags. I created them and set new values to them using our test application. Then I go to SMT to CurrentValues tab and try to view their current values. It works fine.

                           

                          2) SMT is connected and PI Server contains test PI Tags. Using test application I deleted these test tags, create them again and set new values to them. Then I go to SMT to CurrentValues tab. I found these tags, but their current values are "Error reading system digital state". If I restart SMT, it works fine. So, I assume SMT has these tags still in cache and it cannot handle their rebuilt. 

                           

                          As I said, may be I missed something about PI SDK or PI System itself. 

                           

                          I'm guessing that PI Tags are in some cache. When I delete tags, can I somehow modify this cache?

                           

                          Thank you

                           

                           

                           

                           

                           

                           

                           

                           

                           

                           

                            • Re: Issue with Snapshot property of ListData in PISDK code (also in SMT)

                              Hello Vlad,

                               

                              Vlad Krejcirik

                              Purpose of this test case is simple read the same values using our application as we set them using the test application.

                               

                              I understand but I don't see any good reason to delete and re-create tags. Please note that records used in PI Archives by a particular point are not freed up. You will not save place in archives. The opposite is the case. With each tag creation a new primary record is created. Archives will contain a bunch of useless records.

                               

                              Vlad Krejcirik

                              I'm guessing that PI Tags are in some cache. When I delete tags, can I somehow modify this cache?

                               

                              When creating or deleting tags within your application, the cache used by your application will be updated automatically. Other applications would have to update their cache e.g. by dropping the connection and reconnecting.

                               

                              If an application requires being able to handle e.g. point updates there exist as well methods in PI SDK allowing to update the cache programmatically. But how would the application know when to look for updates?

                               

                              This is where PI Update Manager comes into play. This PI Subsystem knows update producers and update consumers. An update producer is e.g. PI Snapshot Subsystem. Each new event (value + timestamp) is forwarded to PI Update Manager. An example for an update consumer is PI ProcessBook. Per default PI ProcessBook updates each 5 seconds but it doesn't need to get all the data that would need to be rendered e.g. in a trend. It just needs the new data. What PI ProcessBook does is signing up with PI Update Manager for snapshot changes. PI Update Manager creates a queue for each update consumer and queues the "news" until they are requested by the consumer. You will recognize that this is no asynchronous operation. The update consumer still has to ask regularly for updates.

                               

                              As far as the point database is concerned an application needs to sign up for updates from producer "ptupdates".

                               

                              I hope this sheds some light but I still recommend to not deleting and creating tags on a regular base. If you are interested getting rid of the data, delete the events from the tags before inserting new ones.

                               

                              Gregor