6 Replies Latest reply on Sep 11, 2017 9:07 AM by Haavard

    Integrate PI and ThingWorx

    alinebordoni

      Hello all,

      I need to integrate two existing systems (one in Coresight, another in ThingWorx) and features from each one meeting the following requirements:

      • I have some displays built in PI Coresight and want to show them in a iframe within ThingWorx, when it's needed.
      • I also need to create new displays with data from PI.
      • When needed, persist information from ThingWorx to PI.

       

      What'd be the best way to integrate both systems? Using PI WebAPI or get data from a URL in Coresight?

       

      Thanks in advance.

        • Re: Integrate PI and ThingWorx
          Jerome Lefebvre

          Hello Aline,

           

          You didn't mention the version of PI Coresight, so I've only tested the links below using PI Coresight 2016.

           

          1. Displaying PI Coresight in a iframe is very easy. All you need to do is something like the following:

           

              <frameset cols='20%,80%' rows='100%' id="main">
                  <frame src=".\AFTree.html" />
                  <frame src="http://{CoresightServer}/Coresight/#/Displays/" />
                  <frame src="" />
          
          

           

          For some browsers, you will also need to edit the web.config file located in %pihome64%\Coresight. To modify the X-Frame-Options customHeaders to set the value to Allow.

           

                <customHeaders>
              <add name="X-Frame-Options" value="Allow"/>
          </customHeaders>
          

           

          2. I am assuming, you don't mean creating displays by hand, but doing something that might be a bit more automatic. You can create new AdHoc displays by simply crafting the right URL. For example, the URL below will create a display with the trend display displaying the past day's worth of data for the Sinusoid and CDT158 tag.

          https://{CoresightServer}/coresight/#/Displays/AdHoc?dataitems=\\{DataArchive}\sinusoid;\\{DataArchive}\cdt158&starttime=*-1d&endtime=*

           

          3. Can you tell me more about what information you want to bring back into PI from ThingWorx?

           

          Cheers,

          Jerome

          3 of 3 people found this helpful
            • Re: Integrate PI and ThingWorx
              alinebordoni

              Hi Jerome, Thanks for you answer.

              I'm using PI Coresight 2016.

              1 and 2... you nailed it.

               

              3 - I want to, for example, change a value of a tag. In this Sinusoid example, let's say it has name tag and I want to change its name and write it back to PI. Does it make sense?

               

                • Re: Integrate PI and ThingWorx
                  Jerome Lefebvre

                  Hello Aline,

                   

                  There is a lot of ways of writing data to PI.

                  But, as you mentioned PI Coresight, for 2016 it is possible to create a custom symbols for PI Coresight 2016 that allows you to manually enter data in a display and have that written to the PI Data Archive. You can see an example of how this could be done in the following blog post:  The specified item was not found. .

                   

                  Or were you looking for something that would be more automatic?

                  1 of 1 people found this helpful
              • Re: Integrate PI and ThingWorx
                pthivierge

                Hello Aline,

                 

                To topic seemed familiar so I just looked again to PI Coresight AD authentication and its good to see you again!

                 

                Jerome Lefebvre, one should not simply change the X-Frame option as this is there for a security reason.  Let me paste what I wrote in the mentioned post above:

                you should be careful if you change the X-Frame option because this security enforcement is there to limit the risk of clickjacking.  if you environment is limited to your intranet and that your IT is ok with this strategy this could be ok.  But be careful here.

                 

                Aline, I belive you will need to use both ways. Using the PI Web API is a good idea for things you can't do with PI Coresight (ex: write TingWorkx data into PI).

                If you are using PI Coresight 2016, you may also look into PI Coresight Extensibility, you could create objects that your users could drag onto their PI Coresight displays.  And those custom objects could be showing information retrieved from TingWorkx Apis, if there is one.

                3 of 3 people found this helpful
                • Re: Integrate PI and ThingWorx
                  jmarriott

                  Hello Aline,

                  I am the OSIsoft Partner Manager for PTC / ThingWorx.  OSIsoft and PTC are jointly working on a product to integrate the PI System with ThingWorx.  At the moment, there is some code that was developed by Systems Engineers that can be used for Proof of Concept.

                  Embedding a PI Vision (fka Coresight) display into a ThingWorx iFrame has been done.  I will connect you with someone who can help.

                    • Re: Integrate PI and ThingWorx
                      Haavard

                      Hi John,

                       

                      I am currently looking into using ThingWorx analytics / machine learning for a new project we are starting.

                      I was therefore wondering about the integration of PI / AF with ThingWorx. Is there a working solution for this, or is it still in development?

                       

                      I haven't found any documentation regarding this on the OSIsoft web-pages, all I seem to find is an announcement on PTC.com from March 2017.