7 Replies Latest reply on Oct 28, 2013 5:50 AM by Henryk Schneider

    PISDK with Perl

    rkadomoto

      Does anyone have any sample code for retrieving RecordedValues using Perl and OLE?

       

      I can get back a Snapshot of data from sinusoid, but am having trouble getting RecordedValues.  I need help with OLE parameters in the method call and also how to iterate through the result set.

       

      Thanks in advance.

        • Re: PISDK with Perl
          hanyong

          Hi Ryan,

           

          I've never really tried using PI SDK on Perl before through WIN32:OLE extension. Have you considered instead of using PI SDK directly in Perl, try to access PI System via the PI OLEDB Providers instead?

           

          Attached is an example of getting data to Perl from PI via the PI OLEDB Classic Provider.

            • Re: PISDK with Perl
              rkadomoto

              Thanks, I'll try that

              • Re: PISDK with Perl
                rkadomoto

                I tried using the OLEDB but I am having trouble opening the connection.  Either my connection string is incorrect or I do not have OLEDB installed.  Is there a way to determine if I have the PIOLEDB?

                  • Re: PISDK with Perl
                    hanyong

                    You can create a file with .udl extension such that it will be opened with the OLE DB Core Services (that helps you configure an OLEDB connection). In the Provider tab, it would show a list of OLEDB Providers installed on the machine: 

                     

                    5875.olebd.jpg

                     

                    If you follow my example, I am using the PI OLEDB (Classic) Provider that connects to a PI Server. You can also choose to use the PI OLEDB Enterprise that connects to PI AF for asset related information. If you need the install kit for either of these providers, you can find them in the Download Center section, under the PI Data Access category

                      • Re: PISDK with Perl
                        Marcos Vainer Loeff

                        Hello Ryan,

                         

                        If you are connecting to a PI Server, you should use PI OLEDB Provider as Han Yong has already said. There two options available for connecting to the PI Server: using WIS (Windows Integrated Security) and using a specific user name and password. If you choose the first option, you should create a new PI mapping for the domain account you will use in order to connect to the PI Server through PI OLEDB Provider. If you choose the second option, you should choose a PI user and type the correct password. 

                         

                         

                         

                        0714.connection.jpg

                         

                        You can click on the “Test connection” button to check if PI OLEDB Provider is able to connect to the PI Server. And finally, if you open the .udl file using any text editor, you will see its connection string!

                         

                        If you are still having problem, please paste the error message you are receiving so that we will be able to help you better.

                         

                        Hope this helps you!