3 Replies Latest reply on Sep 19, 2018 9:47 AM by John Messinger

    Interface details

    SudeshnaB

      Hi All,

      Is there a way to find the type of interface associated to a point-source via AF-SDK?

      Thanks.

        • Re: Interface details
          John Messinger

          Hi Sudeshna,

           

          If you need to do this in code, would suggest you use the PIPointSources and PIPointSource classes in the AFSDK. I haven't been able to test this due to some access issues with my development PI server, but I believe the following code snippet should get you started:

           

          PIServers _piServers = new PIServers();
          PIServer _piServer = _piServers["mypiserver"];
          
          foreach (var ptSource in _piServer.PointSources)
          {
               Console.WriteLine(ptSource.Description);
          }
          

           

          Alternatively, the Pointsources table in PI-SMT can tell you the information you are looking for.

          2 of 2 people found this helpful
            • Re: Interface details
              SudeshnaB

              Thanks john. This code will provide the description if it has been configured in the ICU.

              I was looking for the interface name or type like OPC/PItoPI/OPC-DA/UFL etc.

                • Re: Interface details
                  John Messinger

                  Hi Sudeshna,

                  As I mentioned, I haven't been able to test that code (which I usually do before posting any code examples) - I wasn't 100% sure if the description would include the associated interface type. The only other likely property is the Name property, but I think that is the actual point source itself ("C", "OPC", "#", etc) rather than the name of the associated interface.

                   

                  As far as I know, the actual interface name/type associated to a point source is only stored in the PI Module Database by the PI-ICU for interfaces that have been configured with that application. If this is the case, you would need to implement PI-SDK code to access and traverse the Module Database.

                   

                  I don't think you can get what you are after using the AFSDK, and using the PI-SDK to read the PI-MDB is a little bit ugly but may be your only option for programmatic access to this information.