Download this file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
(* Demonstrates Xml parsing and composing *) FUNCTION_BLOCK FB_XmlPac VAR xBufferInitialised : BOOL := FALSE; File : FB_FileControl; Buffer : ARRAY [0..xmlpac.GVL_Param_XmlControl.MaxFileSize-1] OF BYTE; // or this buffertype ////Buffer : STRING(GVL_Param_XmlControl.MaxFileSize); xCreate : BOOL := TRUE; xParse : BOOL := FALSE; Status : SysFile.SysTypes.RTS_IEC_RESULT; result : xmlpac.E_XmlError; uiParseStep : DINT := 0; xRead : BOOL; XmlFileBytesRead : __XWORD; i : UINT; sTag : STRING; sPara : STRING; sTagPara : STRING; asParsedParameter1 : ARRAY[0..7] OF STRING; asParsedParameter2 : ARRAY[0..7] OF STRING; asParsedData : ARRAY[0..7] OF STRING; index : USINT := 0; END_VAR IF xCreate THEN ComposeXmlExample(); xCreate := FALSE; END_IF; IF xParse THEN Parse(); END_IF