2 Replies Latest reply on Sep 19, 2012 10:48 PM by MIPAC

    Question about possibilities for importing SFI or other format XML elements structure into AF

    VarbanVarbanov

      Hi 

       

      Is there a way to import elements into AF from XML with schema different than the schema used in AF (OSIsoft.AF.xsd) ? As far as I can see it is not, but anyway i'm asking, bacause we have XML documents in SFI format - here is some small example - part of the XML :

       
              <CELL Width="431" Align="left" StyleClass="3">Chain blocks and slings</CELL>
          </LINE>
          <LINE>
            <CELL Width="15" Align="left" StyleClass="11">.</CELL>
            <CELL Width="573" Align="left" ColSpan="2" StyleClass="9">
              <LINES ColCount="2" RowCount="51">
                <LINE>
                  <CELL Width="198" Height="0">
                  </CELL>
                  <CELL Width="390" Height="0">
                  </CELL>
                </LINE>
                <LINE>
                  <CELL Width="198" Align="left" StyleClass="7">960.0001</CELL>
                  <CELL Width="390" Align="left" StyleClass="7">CHAIN BLOCK, ENGINE ROOM</CELL>
                </LINE>
                <LINE>
                  <CELL Width="198" Align="left" StyleClass="7">960.0002</CELL>
                  <CELL Width="390" Align="left" StyleClass="7">CHAIN BLOCK ENGINE E2 0,5 T</CELL>
                </LINE>
                <LINE>
                  <CELL Width="198" Align="left" StyleClass="7">960.0003</CELL>
                  <CELL Width="390" Align="left" StyleClass="7">CHAIN BLOCK ENGINE E3 1,0 T</CELL>
                </LINE>
                <LINE>
                  <CELL Width="198" Align="left" StyleClass="7">960.0004</CELL>
                  <CELL Width="390" Align="left" StyleClass="7">CHAIN BLOCK ENGINE E4 1,0 T</CELL>
                </LINE>
                <LINE>
                  <CELL Width="198" Align="left" StyleClass="7">960.0005</CELL>
                  <CELL Width="390" Align="left" StyleClass="7">CHAIN BLOCK ENGINE E5 2,0 T</CELL>
                </LINE>
                <LINE>
                  <CELL Width="198" Align="left" StyleClass="7">960.0006</CELL>
                  <CELL Width="390" Align="left" StyleClass="7">CHAIN BLOCK ENGINE E6 0,5 T</CELL>
                </LINE>
                <LINE>
                  <CELL Width="198" Align="left" StyleClass="7">960.0007</CELL>
                  <CELL Width="390" Align="left" StyleClass="7">CHAIN BLOCK ENGINE E7 0,5 T</CELL>
                </LINE>
                <LINE>
                  <CELL Width="198" Align="left" StyleClass="7">960.0008</CELL>
                  <CELL Width="390" Align="left" StyleClass="7">CHAIN BLOCK ENGINE E8 0,5 T</CELL>
                </LINE>  
      

      What could be the best way to transform this structure and import it into AF - is parsing our existing xml document and reading its elements and using AF SDK to write the elements into AF the way to do this?

      Thank You and Best Regards!

        • Re: Question about possibilities for importing SFI or other format XML elements structure into AF
          hanyong

          Hi Varban,

           

          As far as I know, I agree with your observation that we can't change the schema for the import and export function in AF SDK (or PI System Explorer). There has to be some sort of conversion that is required to interpret your SFI format XML files.

           

          One option is like what you are thinking, writing a tool that interprets the XML file and creating the equivalent structure in AF. This would be particularly useful if you are going to update the structure in AF on a regular basis from the XML files.

           

          I am not familiar with the SFI format, but if it is possible to open the files in Excel, you can also adjust the format appropriately and export the contents into AF using AF Builder. This option may be better if this is going to be a one time migration, and you may not want to spend time into developing a tool for this.

          • Re: Question about possibilities for importing SFI or other format XML elements structure into AF
            MIPAC

            If you are going to regularly update your AF structure from these SFI formatted XML files, or if you have many to export, transforming your XML with an XSLT file would be an option I would seriously consider. With both source and target schemas known, you should be able to create an appropriate XSL file that handles the transformation. Applying the transform is simple enough in .NET, and the whole transform and export process can then be easily automated.

             

            Regards,

             

            John