5 Replies Latest reply on Oct 17, 2011 10:04 PM by yyzheng

    question: connect PI to MATLAB OPC

    yyzheng

      I read the white paper "using PI Data with MATLAB", and I tried MATLAB OPC toolbox following the commands in the white paper.:

       

      da = opcda('OPCServerNode', 'OSI.DA.1');
      connect(da);

       

      But I got an error message that "Error connecting to server".

       

       

       

      Details shown in MATLAB are below:

       

      >> da = opcda('OPCServerNode', 'OSI.DA.1')

      da =

      Summary of OPC Data Access Client Object: OPCServerNode/OSI.DA.1

         Server Parameters
            Host      : OPCServerNode
            ServerID  : OSI.DA.1
            Status    : disconnected
            Timeout   : 10 seconds

         Object Parameters
            Group     : 0-by-1 dagroup object
            Event Log : 0 of 1000 events

      >> connect(da)
      Error connecting to server.

        • Re: question: connect PI to MATLAB OPC
          hanyong

          Hi Yingying,

           

          Did you replace "OPCServerNode" with the hostname of the machine running PI OPC DA/HDA Server?

           

          You can also test out the OPC Server connection by using other OPC Client tools first, and replace the settings like hostname appropriately after connection to the OPC Server can be established successfully.

            • Re: question: connect PI to MATLAB OPC

              To Han Yong's point, you should try and get the OPC connection working with the generic OPC Client tool we supply. Please do not hesitate to contact our regular Technical Support team if you need assistance on installing and configuring this - then the vCampus community can help you take the programming portion of it to the finish line :)

                • Re: question: connect PI to MATLAB OPC
                  yyzheng

                  Han Yong,  How can I find out the hostname of the machine running PI OPC DA/HDA server?

                   

                  Steve, Where can I download your generic OPC client tool?

                    • Re: question: connect PI to MATLAB OPC
                      hanyong

                      Hi Yingying,

                       

                      Did you installed the PI OPC DA/HDA server yourself? If you have access to the machine, it can be a simple task like looking at the properties of the machine or running the command "hostname" in command prompt of the machine.

                       

                      If you are not sure where is the PI OPC DA/HDA server located, then you probably need to find out from the other PI administrators to find out if there is a PI OPC DA/HDA server installed in the environment and where. If you are working on this in your personal development environment, you can always download the install kit for PI OPC DA/HDA server from the Download Center. 

                       

                      PI OPC Client is installed together with PI OPC DA/HDA Server. So you should be able to find in ...\PIPC\PI-OPC Tools\PI_OPCClient\. Again if you are not sure about how to use the client, you can always contact our regular techsupport for help as Steve suggested.