Diff of /branch/xmlresultformatter/XmlResultFormatter-OpenPLC.xml [000000] .. [r293]  Maximize  Restore

Switch to unified view

a b/branch/xmlresultformatter/XmlResultFormatter-OpenPLC.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<project xmlns="http://www.plcopen.org/xml/tc6_0200">
3
  <fileHeader companyName="" productName="CODESYS" productVersion="CODESYS V3.5 SP15" creationDateTime="2019-12-26T21:10:01.304469" />
4
  <contentHeader name="XmlResultFormatter.project" modificationDateTime="2019-12-26T20:38:04.3246887">
5
    <coordinateInfo>
6
      <fbd>
7
        <scaling x="1" y="1" />
8
      </fbd>
9
      <ld>
10
        <scaling x="1" y="1" />
11
      </ld>
12
      <sfc>
13
        <scaling x="1" y="1" />
14
      </sfc>
15
    </coordinateInfo>
16
    <addData>
17
      <data name="http://www.3s-software.com/plcopenxml/projectinformation" handleUnknown="implementation">
18
        <ProjectInformation>
19
          <property name="CompiledLibraryCompatibilityVersion" type="string">CODESYS V3.5 SP14 Patch 2</property>
20
          <property name="Project" type="string">XmlResultFormatter</property>
21
        </ProjectInformation>
22
      </data>
23
    </addData>
24
  </contentHeader>
25
  <types>
26
    <dataTypes>
27
      <dataType name="E_XmlError">
28
        <baseType>
29
          <enum>
30
            <values>
31
              <value name="Ok" value="0" />
32
              <value name="ErrorMaxBufferLen" value="1" />
33
              <value name="ErrorStringLen" value="2" />
34
              <value name="Error" value="3" />
35
            </values>
36
            <baseType>
37
              <BYTE />
38
            </baseType>
39
          </enum>
40
        </baseType>
41
        <addData>
42
          <data name="http://www.3s-software.com/plcopenxml/attributes" handleUnknown="implementation">
43
            <Attributes>
44
              <Attribute Name="qualified_only" Value="" />
45
              <Attribute Name="strict" Value="" />
46
            </Attributes>
47
          </data>
48
          <data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
49
            <ObjectId>05a4fdda-1086-47b5-ad10-7c2bac568355</ObjectId>
50
          </data>
51
        </addData>
52
      </dataType>
53
      <dataType name="T_MaxString">
54
        <baseType>
55
          <string length="255" />
56
        </baseType>
57
        <addData>
58
          <data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
59
            <ObjectId>a429e267-db3b-4872-871e-1ca509b971e2</ObjectId>
60
          </data>
61
        </addData>
62
      </dataType>
63
    </dataTypes>
64
    <pous>
65
      <pou name="prg_Example" pouType="program">
66
        <interface>
67
          <localVars>
68
            <variable name="XmlPac">
69
              <type>
70
                <derived name="FB_XmlPac" />
71
              </type>
72
            </variable>
73
            <variable name="XmlFileFormatter">
74
              <type>
75
                <derived name="FB_XmlFileFormatter" />
76
              </type>
77
            </variable>
78
            <variable name="xUnitFileComposer">
79
              <type>
80
                <derived name="I_TestResultFormatter" />
81
              </type>
82
              <initialValue>
83
                <simpleValue value="XmlFileFormatter" />
84
              </initialValue>
85
            </variable>
86
            <variable name="BusyGeneratingXml">
87
              <type>
88
                <BOOL />
89
              </type>
90
            </variable>
91
            <variable name="DoneGeneratingXml">
92
              <type>
93
                <BOOL />
94
              </type>
95
            </variable>
96
            <variable name="NumberOfTestSuitesFinished">
97
              <type>
98
                <UINT />
99
              </type>
100
              <initialValue>
101
                <simpleValue value="3" />
102
              </initialValue>
103
            </variable>
104
            <variable name="NumberOfTestCases">
105
              <type>
106
                <UINT />
107
              </type>
108
              <initialValue>
109
                <simpleValue value="9" />
110
              </initialValue>
111
            </variable>
112
            <variable name="NumberOfSuccessfulTestCases">
113
              <type>
114
                <UINT />
115
              </type>
116
              <initialValue>
117
                <simpleValue value="0" />
118
              </initialValue>
119
            </variable>
120
            <variable name="NumberOfFailedTestCases">
121
              <type>
122
                <UINT />
123
              </type>
124
              <initialValue>
125
                <simpleValue value="9" />
126
              </initialValue>
127
            </variable>
128
          </localVars>
129
        </interface>
130
        <body>
131
          <ST>
132
            <xhtml xmlns="http://www.w3.org/1999/xhtml">XmlPac();
133
134
IF NOT DoneGeneratingXml THEN
135
    xUnitFileComposer.Format(NumberOfTestSuites := NumberOfTestSuitesFinished,
136
                               NumberOfTestCases := NumberOfTestCases,
137
                               NumberOfSuccessfulTestCases := NumberOfSuccessfulTestCases,
138
                               NumberOfFailedTestCases := NumberOfFailedTestCases,
139
                               Busy =&gt; BusyGeneratingXml);
140
    DoneGeneratingXml := NOT BusyGeneratingXml;  
141
END_IF;</xhtml>
142
          </ST>
143
        </body>
144
        <addData>
145
          <data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
146
            <ObjectId>917c49f4-3643-42fe-b791-ac2edc0df35b</ObjectId>
147
          </data>
148
        </addData>
149
      </pou>
150
      <pou name="FB_XmlFileFormatter" pouType="functionBlock">
151
        <interface>
152
          <inputVars>
153
            <variable name="stFileAccessMode">
154
              <type>
155
                <derived name="SysFile.ACCESS_MODE" />
156
              </type>
157
              <initialValue>
158
                <simpleValue value="SysFile.AM_WRITE_PLUS" />
159
              </initialValue>
160
              <documentation>
161
                <xhtml xmlns="http://www.w3.org/1999/xhtml"> Default file access mode </xhtml>
162
              </documentation>
163
            </variable>
164
          </inputVars>
165
          <localVars>
166
            <variable name="szFilename">
167
              <type>
168
                <string />
169
              </type>
170
              <initialValue>
171
                <simpleValue value="''" />
172
              </initialValue>
173
            </variable>
174
            <variable name="xBufferInitialised">
175
              <type>
176
                <BOOL />
177
              </type>
178
              <initialValue>
179
                <simpleValue value="FALSE" />
180
              </initialValue>
181
              <documentation>
182
                <xhtml xmlns="http://www.w3.org/1999/xhtml"> Is buffer Initialised? </xhtml>
183
              </documentation>
184
            </variable>
185
            <variable name="File">
186
              <type>
187
                <derived name="FB_FileControl" />
188
              </type>
189
            </variable>
190
            <variable name="Xml">
191
              <type>
192
                <derived name="FB_XmlControl" />
193
              </type>
194
            </variable>
195
            <variable name="Buffer">
196
              <type>
197
                <string length="GVL_Param_XmlControl.MaxFileSize" />
198
              </type>
199
              <documentation>
200
                <xhtml xmlns="http://www.w3.org/1999/xhtml"> Buffer : ARRAY [0..GVL_Param_XmlControl.MaxFileSize-1] OF BYTE;
201
 Or</xhtml>
202
              </documentation>
203
            </variable>
204
          </localVars>
205
          <addData>
206
            <data name="http://www.3s-software.com/plcopenxml/pouinheritance" handleUnknown="implementation">
207
              <Inheritance>
208
                <Implements>I_TestResultFormatter</Implements>
209
              </Inheritance>
210
            </data>
211
          </addData>
212
          <documentation>
213
            <xhtml xmlns="http://www.w3.org/1999/xhtml">
214
    This function block reports the results from the tests into a xUnit compatible XmlFile
215
</xhtml>
216
          </documentation>
217
        </interface>
218
        <body>
219
          <ST>
220
            <xhtml xmlns="http://www.w3.org/1999/xhtml" />
221
          </ST>
222
        </body>
223
        <addData>
224
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
225
            <Method name="Format" ObjectId="b6b6021c-eac1-4ed2-91cd-9954fbe29c28">
226
              <interface>
227
                <inputVars>
228
                  <variable name="NumberOfTestSuites">
229
                    <type>
230
                      <UINT />
231
                    </type>
232
                    <documentation>
233
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> The total number of test suites </xhtml>
234
                    </documentation>
235
                  </variable>
236
                  <variable name="NumberOfTestCases">
237
                    <type>
238
                      <UINT />
239
                    </type>
240
                    <documentation>
241
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> The total number of test cases (for all test function blocks) </xhtml>
242
                    </documentation>
243
                  </variable>
244
                  <variable name="NumberOfSuccessfulTestCases">
245
                    <type>
246
                      <UINT />
247
                    </type>
248
                    <documentation>
249
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> The total number of test cases that had all ASSERTS successful </xhtml>
250
                    </documentation>
251
                  </variable>
252
                  <variable name="NumberOfFailedTestCases">
253
                    <type>
254
                      <UINT />
255
                    </type>
256
                    <documentation>
257
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> The total number of test cases that had at least one ASSERT failed </xhtml>
258
                    </documentation>
259
                  </variable>
260
                </inputVars>
261
                <localVars>
262
                  <variable name="SuiteCounter">
263
                    <type>
264
                      <UINT />
265
                    </type>
266
                  </variable>
267
                  <variable name="TestCounter">
268
                    <type>
269
                      <UINT />
270
                    </type>
271
                  </variable>
272
                  <variable name="TestSuiteName">
273
                    <type>
274
                      <derived name="T_MaxString" />
275
                    </type>
276
                  </variable>
277
                  <variable name="NumberOfFailedTestsInCurrentSuite">
278
                    <type>
279
                      <UINT />
280
                    </type>
281
                  </variable>
282
                  <variable name="NumberOfTestsInCurrentSuite">
283
                    <type>
284
                      <UINT />
285
                    </type>
286
                  </variable>
287
                  <variable name="TestCaseName">
288
                    <type>
289
                      <derived name="T_MaxString" />
290
                    </type>
291
                  </variable>
292
                  <variable name="AssertResult">
293
                    <type>
294
                      <derived name="T_MaxString" />
295
                    </type>
296
                  </variable>
297
                </localVars>
298
                <outputVars>
299
                  <variable name="Busy">
300
                    <type>
301
                      <BOOL />
302
                    </type>
303
                  </variable>
304
                </outputVars>
305
                <documentation>
306
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> Responsible for formatting the xml file skeleton
307
  &lt;testsuites&gt;        =&gt; the aggregated result OF all xunit testfiles
308
   &lt;testsuite&gt;       =&gt; the output from a single TestSuite
309
     &lt;properties&gt;    =&gt; the defined properties at test execution
310
       &lt;property&gt;    =&gt; name/value pair for a single property
311
       ...
312
     &lt;/properties&gt;
313
     &lt;error&gt;&lt;/error&gt; =&gt; optional information, in place of a test case - normally if the tests in the suite could not be found etc.
314
     &lt;testcase&gt;      =&gt; the results from executing a test method
315
       &lt;system-out&gt;  =&gt; data written to System.out during the test run
316
       &lt;system-err&gt;  =&gt; data written to System.err during the test run
317
       &lt;skipped/&gt;    =&gt; test was skipped
318
       &lt;failure&gt;     =&gt; test failed
319
       &lt;error&gt;       =&gt; test encountered an error
320
     &lt;/testcase&gt;
321
     ...
322
   &lt;/testsuite&gt;
323
   ...
324
 &lt;/testsuites&gt;</xhtml>
325
                </documentation>
326
              </interface>
327
              <body>
328
                <ST>
329
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">Busy := TRUE;
330
331
NumberOfTestsInCurrentSuite := 3;
332
333
IF NumberOfFailedTestCases &gt; 0 THEN
334
    LOGSTR(msgCtrlMask := UDINT_TO_DWORD(CmpLog.LogClass.LOG_INFO),
335
           msgFmtStr := '%s',
336
           strArg := '| ========= Export Xml Report =========');
337
                                          
338
    (* &lt;?xml version="1.0" encoding="UTF-8"?&gt; *)
339
    Xml.writeDocumentHeader(Header := '&lt;?xml version="1.0" encoding="UTF-8"?&gt;');
340
    xml.NewTag('testsuites');
341
    FOR SuiteCounter := 1 TO NumberOfTestSuites BY 1 DO 
342
        (* &lt;testsuite&gt; *)
343
        xml.NewTag('testsuite');
344
        
345
        (* name="name" *)
346
        //TestSuiteInstancePath := 'TestInstancePath'
347
        TestSuiteName := 'TestSuiteName';
348
        Xml.NewParameter('name', TestSuiteName);
349
        
350
        (* &lt;testsuite errors="errors"&gt; *)
351
        //NumberOfFailedTestsInCurrentSuite := UINT_TO_STRING(NumberOfFailedTestCases);
352
        Xml.NewParameter('errors', UINT_TO_STRING(NumberOfFailedTestsInCurrentSuite));
353
        
354
        (* &lt;testsuite errors="errors" tests="tests"&gt;*)
355
    
356
        Xml.NewParameter('tests', UINT_TO_STRING(NumberOfTestsInCurrentSuite));
357
        
358
        (* close testsuite *)
359
        Xml.CloseTag();
360
        
361
        FOR TestCounter := 1 TO NumberOfTestsInCurrentSuite BY 1 DO
362
            
363
            //IF GVL_CfUnit.TestSuiteAddresses[SuiteCounter]^.Tests[TestCounter].IsFailed() THEN
364
            IF TRUE THEN
365
                
366
                (* get testcase name *)
367
                //TestCaseName :=  GVL_CfUnit.TestSuiteAddresses[SuiteCounter]^.Tests[TestCounter].GetName();
368
                TestCaseName := 'TestCaseName';
369
                Xml.NewTag('testcase');
370
                Xml.NewParameter('name', TestCaseName);
371
                (* close testcase *)
372
                Xml.CloseTag();    
373
                
374
                Xml.NewTag('failure');
375
                //AssertResult := GVL_CfUnit.TestSuiteAddresses[SuiteCounter]^.AssertResults.AssertResults[TestCounter];
376
                //Xml.NewParameter('message', AssertResult.Message );
377
                Xml.NewParameter('message', 'AssertResultMessage' );
378
                Xml.NewTagData('Assertion failed');
379
                (* close failure *)
380
                Xml.CloseTag();
381
            END_IF
382
        END_FOR
383
    END_FOR
384
    
385
    (* Close testsuites *)
386
    Xml.CloseTag();
387
388
    (* Open, save and close the file *)
389
    OpenSaveAndClose();
390
END_IF
391
392
Busy := FALSE;</xhtml>
393
                </ST>
394
              </body>
395
              <addData />
396
            </Method>
397
          </data>
398
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
399
            <Method name="FB_Init" ObjectId="0f23c47b-7245-415e-b489-0ae429217263">
400
              <interface>
401
                <returnType>
402
                  <BOOL />
403
                </returnType>
404
                <inputVars>
405
                  <variable name="bInitRetains">
406
                    <type>
407
                      <BOOL />
408
                    </type>
409
                    <documentation>
410
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> TRUE: the retain variables are initialized (reset warm / reset cold)</xhtml>
411
                    </documentation>
412
                  </variable>
413
                  <variable name="bInCopyCode">
414
                    <type>
415
                      <BOOL />
416
                    </type>
417
                    <documentation>
418
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> TRUE: the instance will be copied to the copy code afterward (online change)</xhtml>
419
                    </documentation>
420
                  </variable>
421
                </inputVars>
422
                <documentation>
423
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">FB_Init is always available implicitly and it is used primarily for initialization.
424
The return value is not evaluated. For a specific influence, you can also declare the
425
methods explicitly and provide additional code there with the standard initialization
426
code. You can evaluate the return value.</xhtml>
427
                </documentation>
428
              </interface>
429
              <body>
430
                <ST>
431
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">// Set Filepath
432
szFilename := GVL_Param_XmlControl.FilePath;
433
// Set buffer and flag
434
Xml.SetBuffer(pString := ADR(Buffer), iSizeOf := SIZEOF(Buffer));
435
xBufferInitialised := TRUE;</xhtml>
436
                </ST>
437
              </body>
438
              <addData />
439
            </Method>
440
          </data>
441
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
442
            <Method name="OpenSaveAndClose" ObjectId="bdefa095-3448-4b85-b486-ff4d5205677b">
443
              <interface>
444
                <returnType>
445
                  <BOOL />
446
                </returnType>
447
                <addData>
448
                  <data name="http://www.3s-software.com/plcopenxml/accessmodifiers" handleUnknown="implementation">
449
                    <AccessModifiers Private="true" />
450
                  </data>
451
                </addData>
452
              </interface>
453
              <body>
454
                <ST>
455
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">// write buffer to a file
456
File.Open(Filename := szFilename, FileAccessMode := stFileAccessMode);
457
File.Save(pString := ADR(Buffer), xml.Length );
458
File.Close();
459
460
Xml.ClearBuffer();</xhtml>
461
                </ST>
462
              </body>
463
              <addData />
464
            </Method>
465
          </data>
466
          <data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
467
            <ObjectId>6597c0b3-0890-4d5d-8d3a-2d0d0b2355db</ObjectId>
468
          </data>
469
        </addData>
470
      </pou>
471
      <pou name="FB_FileControl" pouType="functionBlock">
472
        <interface>
473
          <localVars>
474
            <variable name="FileAccessMode">
475
              <type>
476
                <derived name="SysFile.ACCESS_MODE" />
477
              </type>
478
              <initialValue>
479
                <simpleValue value="SysFile.AM_WRITE_PLUS" />
480
              </initialValue>
481
              <addData>
482
                <data name="http://www.3s-software.com/plcopenxml/attributes" handleUnknown="implementation">
483
                  <Attributes>
484
                    <Attribute Name="hide" Value="" />
485
                  </Attributes>
486
                </data>
487
              </addData>
488
            </variable>
489
            <variable name="FileHandle">
490
              <type>
491
                <derived name="SysFile.SysTypes.RTS_IEC_HANDLE" />
492
              </type>
493
              <addData>
494
                <data name="http://www.3s-software.com/plcopenxml/attributes" handleUnknown="implementation">
495
                  <Attributes>
496
                    <Attribute Name="hide" Value="" />
497
                  </Attributes>
498
                </data>
499
              </addData>
500
            </variable>
501
          </localVars>
502
          <addData>
503
            <data name="http://www.3s-software.com/plcopenxml/attributes" handleUnknown="implementation">
504
              <Attributes>
505
                <Attribute Name="hide_all_locals" Value="" />
506
              </Attributes>
507
            </data>
508
          </addData>
509
        </interface>
510
        <body>
511
          <ST>
512
            <xhtml xmlns="http://www.w3.org/1999/xhtml" />
513
          </ST>
514
        </body>
515
        <addData>
516
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
517
            <Method name="Close" ObjectId="519e9011-283c-40b1-afd4-31686c5b81fe">
518
              <interface>
519
                <returnType>
520
                  <derived name="SysFile.SysTypes.RTS_IEC_RESULT" />
521
                </returnType>
522
                <documentation>
523
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> Closes the current file</xhtml>
524
                </documentation>
525
              </interface>
526
              <body>
527
                <ST>
528
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">IF FileHandle &lt;&gt; SysFile.SysTypes.RTS_INVALID_HANDLE THEN
529
    Close := SysFile.SysFileClose(hFile := FileHandle);
530
END_IF</xhtml>
531
                </ST>
532
              </body>
533
              <addData />
534
            </Method>
535
          </data>
536
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
537
            <Method name="Open" ObjectId="1873bb2c-c6a3-4681-8948-02aa2bad0a9b">
538
              <interface>
539
                <returnType>
540
                  <derived name="SysFile.SysTypes.RTS_IEC_RESULT" />
541
                </returnType>
542
                <inputVars>
543
                  <variable name="FileName">
544
                    <type>
545
                      <derived name="T_MaxString" />
546
                    </type>
547
                    <initialValue>
548
                      <simpleValue value="'filepath/output.xml'" />
549
                    </initialValue>
550
                    <documentation>
551
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> File name can contain an absolute or relative path to the file. Path entries must be separated with a Slash (/)</xhtml>
552
                    </documentation>
553
                  </variable>
554
                  <variable name="FileAccessMode">
555
                    <type>
556
                      <derived name="SysFile.ACCESS_MODE" />
557
                    </type>
558
                    <initialValue>
559
                      <simpleValue value="SysFile.ACCESS_MODE.AM_APPEND_PLUS" />
560
                    </initialValue>
561
                  </variable>
562
                </inputVars>
563
                <documentation>
564
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> Opens a file</xhtml>
565
                </documentation>
566
              </interface>
567
              <body>
568
                <ST>
569
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">FileHandle := SysFile.SysFileOpen(szFile := Filename,
570
                                  am := FileAccessMode,
571
                                  pResult := ADR(Open));</xhtml>
572
                </ST>
573
              </body>
574
              <addData />
575
            </Method>
576
          </data>
577
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
578
            <Method name="Read" ObjectId="3984ae50-1cdb-4045-af99-0bb56917afb2">
579
              <interface>
580
                <returnType>
581
                  <derived name="SysFile.SysTypes.RTS_IEC_RESULT" />
582
                </returnType>
583
                <inputVars>
584
                  <variable name="pString">
585
                    <type>
586
                      <pointer>
587
                        <baseType>
588
                          <BYTE />
589
                        </baseType>
590
                      </pointer>
591
                    </type>
592
                    <documentation>
593
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> Call with ADR();</xhtml>
594
                    </documentation>
595
                  </variable>
596
                  <variable name="Size">
597
                    <type>
598
                      <UDINT />
599
                    </type>
600
                    <documentation>
601
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> Call with SIZEOF(); </xhtml>
602
                    </documentation>
603
                  </variable>
604
                </inputVars>
605
                <outputVars>
606
                  <variable name="FileSize">
607
                    <type>
608
                      <derived name="SysFile.SysTypes.RTS_IEC_SIZE" />
609
                    </type>
610
                  </variable>
611
                </outputVars>
612
              </interface>
613
              <body>
614
                <ST>
615
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">IF FileHandle &lt;&gt; SysFile.SysTypes.RTS_INVALID_HANDLE THEN
616
    FileSize := SysFile.SysFileread(hFile := FileHandle, 
617
                                    pbyBuffer := pString,
618
                                    ulSize := Size,
619
                                    pResult := ADR(Read));
620
END_IF</xhtml>
621
                </ST>
622
              </body>
623
              <addData />
624
            </Method>
625
          </data>
626
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
627
            <Method name="Save" ObjectId="c4146a99-50c6-4ce0-88ab-794dbfb1af62">
628
              <interface>
629
                <returnType>
630
                  <derived name="SysFile.SysTypes.RTS_IEC_RESULT" />
631
                </returnType>
632
                <inputVars>
633
                  <variable name="pString">
634
                    <type>
635
                      <pointer>
636
                        <baseType>
637
                          <BYTE />
638
                        </baseType>
639
                      </pointer>
640
                    </type>
641
                    <documentation>
642
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> Call with ADR();</xhtml>
643
                    </documentation>
644
                  </variable>
645
                  <variable name="Size">
646
                    <type>
647
                      <UDINT />
648
                    </type>
649
                    <documentation>
650
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> Call with SIZEOF();</xhtml>
651
                    </documentation>
652
                  </variable>
653
                </inputVars>
654
                <documentation>
655
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> Saves the contents of the buffer into a file
656
 Be sure to call Open() before calling Save()</xhtml>
657
                </documentation>
658
              </interface>
659
              <body>
660
                <ST>
661
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">IF FileHandle &lt;&gt; SysFile.SysTypes.RTS_INVALID_HANDLE THEN
662
    SysFile.SysFileWrite(hFile := FileHandle,
663
                         pbyBuffer := pString,
664
                         ulSize := Size,
665
                         pResult := ADR(Save));
666
END_IF</xhtml>
667
                </ST>
668
              </body>
669
              <addData />
670
            </Method>
671
          </data>
672
          <data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
673
            <ObjectId>c9bec8fc-2de3-45f4-b839-e6c4276a6b5a</ObjectId>
674
          </data>
675
        </addData>
676
      </pou>
677
      <pou name="FB_StreamBuffer" pouType="functionBlock">
678
        <interface>
679
          <localVars>
680
            <variable name="pStrBuf">
681
              <type>
682
                <pointer>
683
                  <baseType>
684
                    <BYTE />
685
                  </baseType>
686
                </pointer>
687
              </type>
688
            </variable>
689
            <variable name="udiBufSize">
690
              <type>
691
                <UDINT />
692
              </type>
693
            </variable>
694
            <variable name="udiLength">
695
              <type>
696
                <UDINT />
697
              </type>
698
            </variable>
699
          </localVars>
700
          <documentation>
701
            <xhtml xmlns="http://www.w3.org/1999/xhtml">
702
    This functionblock acts as a stream buffer for use with FB_XmlControl
703
</xhtml>
704
          </documentation>
705
        </interface>
706
        <body>
707
          <ST>
708
            <xhtml xmlns="http://www.w3.org/1999/xhtml" />
709
          </ST>
710
        </body>
711
        <addData>
712
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
713
            <Method name="Clear" ObjectId="5f0bbce2-2600-4a2e-8c6f-4b957ad03395">
714
              <interface>
715
                <localVars>
716
                  <variable name="i">
717
                    <type>
718
                      <UDINT />
719
                    </type>
720
                  </variable>
721
                </localVars>
722
                <documentation>
723
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> Clears the buffer and sets the length to 0</xhtml>
724
                </documentation>
725
              </interface>
726
              <body>
727
                <ST>
728
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">IF (pStrBuf = 0) OR (udiBufsize = 0) THEN
729
    RETURN;
730
END_IF
731
732
FOR i := 0 TO (udiBufsize-1) DO
733
    pStrBuf[i] := 0;
734
END_FOR
735
736
udiLength := 0; </xhtml>
737
                </ST>
738
              </body>
739
              <addData />
740
            </Method>
741
          </data>
742
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
743
            <Method name="Copy" ObjectId="b796dd60-63f5-4b75-acc5-8fa40e24be46">
744
              <interface>
745
                <returnType>
746
                  <derived name="T_MaxString" />
747
                </returnType>
748
                <inputVars>
749
                  <variable name="udiStart">
750
                    <type>
751
                      <UDINT />
752
                    </type>
753
                  </variable>
754
                  <variable name="udiEnd">
755
                    <type>
756
                      <UDINT />
757
                    </type>
758
                  </variable>
759
                </inputVars>
760
                <outputVars>
761
                  <variable name="udiCopyLen">
762
                    <type>
763
                      <UDINT />
764
                    </type>
765
                  </variable>
766
                  <variable name="XmlError">
767
                    <type>
768
                      <derived name="E_XmlError" />
769
                    </type>
770
                  </variable>
771
                </outputVars>
772
                <localVars>
773
                  <variable name="udiLoop">
774
                    <type>
775
                      <UDINT />
776
                    </type>
777
                  </variable>
778
                  <variable name="pByteCopy">
779
                    <type>
780
                      <pointer>
781
                        <baseType>
782
                          <BYTE />
783
                        </baseType>
784
                      </pointer>
785
                    </type>
786
                  </variable>
787
                  <variable name="pByteBuffer">
788
                    <type>
789
                      <pointer>
790
                        <baseType>
791
                          <BYTE />
792
                        </baseType>
793
                      </pointer>
794
                    </type>
795
                  </variable>
796
                </localVars>
797
                <documentation>
798
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">
799
    Copies a string from the character buffer
800
</xhtml>
801
                </documentation>
802
              </interface>
803
              <body>
804
                <ST>
805
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">udiLoop := 0;
806
pByteCopy := ADR(Copy);
807
pByteBuffer := pStrBuf + udiStart - 1;
808
809
WHILE(udiLoop &lt; SIZEOF(Copy)) AND udiStart - 1 + udiLoop &lt; udiLength AND udiStart + udiLoop &lt; udiEnd DO
810
    pByteCopy^ := pByteBuffer^;
811
    udiLoop := udiLoop + 1;
812
    pByteCopy := ADR(Copy) + udiLoop;
813
    pByteBuffer := pStrBuf + udiStart + udiLoop -1;
814
END_WHILE;
815
816
IF udiLoop = SIZEOF(Copy) THEN
817
    XmlError := E_XmlError.ErrorStringLen;
818
ELSIF udiStart - 1 + udiLoop = udiLength THEN
819
    XmlError := E_XmlError.ErrorMaxBufferLen;
820
ELSE
821
    XmlError := E_XmlError.OK;
822
END_IF;
823
824
pByteCopy^ := 0;
825
udiCopyLen :=  udiLoop;</xhtml>
826
                </ST>
827
              </body>
828
              <addData />
829
            </Method>
830
          </data>
831
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
832
            <Method name="CutOff" ObjectId="8914e4f8-8b6c-48c3-ba1f-e0642038624a">
833
              <interface>
834
                <returnType>
835
                  <string />
836
                </returnType>
837
                <inputVars>
838
                  <variable name="udiStartPos">
839
                    <type>
840
                      <UDINT />
841
                    </type>
842
                  </variable>
843
                </inputVars>
844
                <outputVars>
845
                  <variable name="udiCutLen">
846
                    <type>
847
                      <UDINT />
848
                    </type>
849
                  </variable>
850
                  <variable name="XmlError">
851
                    <type>
852
                      <derived name="E_XmlError" />
853
                    </type>
854
                  </variable>
855
                </outputVars>
856
                <localVars>
857
                  <variable name="iLoop">
858
                    <type>
859
                      <UDINT />
860
                    </type>
861
                  </variable>
862
                  <variable name="pByteCut">
863
                    <type>
864
                      <pointer>
865
                        <baseType>
866
                          <BYTE />
867
                        </baseType>
868
                      </pointer>
869
                    </type>
870
                  </variable>
871
                  <variable name="pByteBuffer">
872
                    <type>
873
                      <pointer>
874
                        <baseType>
875
                          <BYTE />
876
                        </baseType>
877
                      </pointer>
878
                    </type>
879
                  </variable>
880
                </localVars>
881
              </interface>
882
              <body>
883
                <ST>
884
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">iLoop := 0;
885
pByteCut := ADR(CutOff);
886
pByteBuffer := pStrBuf + udiStartPos - 1;
887
888
WHILE pByteBuffer^ &lt;&gt; 0 AND(iLoop &lt; SIZEOF(CutOff)) AND udiStartPos -1  + iLoop &lt; udiLength DO
889
    pByteCut^ := pByteBuffer^;
890
    iLoop := iLoop + 1;
891
    pByteCut := ADR(CutOff) + iLoop;
892
    pByteBuffer := pStrBuf + udiStartPos - 1 + iLoop;
893
END_WHILE;
894
895
IF pByteBuffer^ = 0 THEN
896
    XmlError := E_XmlError.OK;
897
ELSIF iLoop = SIZEOF(CutOff) THEN
898
    XmlError := E_XmlError.ErrorStringLen;
899
ELSIF udiStartPos -1 + iLoop = udiLength THEN
900
    XmlError := E_XmlError.ErrorMaxBufferLen;
901
END_IF;
902
903
pByteCut^ := 0;
904
udiLength := udiStartPos -1;
905
906
pByteBuffer := pStrBuf + udiStartPos - 1;
907
pByteBuffer^ := 0;
908
909
udiCutLen := iLoop;</xhtml>
910
                </ST>
911
              </body>
912
              <addData />
913
            </Method>
914
          </data>
915
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
916
            <Method name="Find" ObjectId="7e38490a-9555-451d-957e-fef284a567e3">
917
              <interface>
918
                <returnType>
919
                  <UDINT />
920
                </returnType>
921
                <inputVars>
922
                  <variable name="sSearchString">
923
                    <type>
924
                      <string />
925
                    </type>
926
                  </variable>
927
                  <variable name="udiStartPos">
928
                    <type>
929
                      <UDINT />
930
                    </type>
931
                  </variable>
932
                </inputVars>
933
                <localVars>
934
                  <variable name="udiLoop">
935
                    <type>
936
                      <UDINT />
937
                    </type>
938
                  </variable>
939
                  <variable name="iSearch">
940
                    <type>
941
                      <UDINT />
942
                    </type>
943
                  </variable>
944
                  <variable name="pBuffer">
945
                    <type>
946
                      <pointer>
947
                        <baseType>
948
                          <BYTE />
949
                        </baseType>
950
                      </pointer>
951
                    </type>
952
                  </variable>
953
                  <variable name="pSearch">
954
                    <type>
955
                      <pointer>
956
                        <baseType>
957
                          <BYTE />
958
                        </baseType>
959
                      </pointer>
960
                    </type>
961
                  </variable>
962
                </localVars>
963
                <documentation>
964
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> 
965
    Find a searchstring in the buffer and returns its position.
966
    It's possible to add a preffered startposition within buffer
967
</xhtml>
968
                </documentation>
969
              </interface>
970
              <body>
971
                <ST>
972
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">udiLoop := 0;
973
iSearch := 0;
974
975
pBuffer := pStrBuf + udiStartPos;
976
pSearch := ADR( sSearchString);
977
978
WHILE(pSearch^ &lt;&gt; 0 ) AND udiLoop + udiStartPos &lt; udiLength DO
979
    IF pBuffer^ &lt;&gt; pSearch^ THEN
980
        udiLoop := udiLoop + 1;
981
        pBuffer := pStrBuf + udiStartPos + udiLoop;
982
        pSearch := ADR( sSearchString);
983
        iSearch := 0;
984
    ELSE
985
        iSearch := iSearch +1;
986
        pBuffer := pStrBuf + udiStartPos + udiLoop + iSearch;
987
        pSearch := ADR( sSearchString ) + iSearch;
988
    END_IF;
989
END_WHILE;
990
Find := udiLoop + 1 + udiStartPos;</xhtml>
991
                </ST>
992
              </body>
993
              <addData />
994
            </Method>
995
          </data>
996
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
997
            <Method name="FindBack" ObjectId="7d08b204-2078-4fde-81eb-e04d71986196">
998
              <interface>
999
                <returnType>
1000
                  <UDINT />
1001
                </returnType>
1002
                <inputVars>
1003
                  <variable name="sSearchString">
1004
                    <type>
1005
                      <derived name="T_MaxString" />
1006
                    </type>
1007
                  </variable>
1008
                </inputVars>
1009
                <localVars>
1010
                  <variable name="udiLoop">
1011
                    <type>
1012
                      <UDINT />
1013
                    </type>
1014
                  </variable>
1015
                  <variable name="udiSearch">
1016
                    <type>
1017
                      <UDINT />
1018
                    </type>
1019
                  </variable>
1020
                  <variable name="pBuffer">
1021
                    <type>
1022
                      <pointer>
1023
                        <baseType>
1024
                          <BYTE />
1025
                        </baseType>
1026
                      </pointer>
1027
                    </type>
1028
                  </variable>
1029
                  <variable name="pSearch">
1030
                    <type>
1031
                      <pointer>
1032
                        <baseType>
1033
                          <BYTE />
1034
                        </baseType>
1035
                      </pointer>
1036
                    </type>
1037
                  </variable>
1038
                </localVars>
1039
              </interface>
1040
              <body>
1041
                <ST>
1042
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">udiLoop := 0;
1043
udiSearch := 0;
1044
1045
pBuffer := pStrBuf + udiLength;
1046
pSearch := ADR(sSearchString);
1047
1048
WHILE(pSearch^ &lt;&gt; 0 ) AND udiLoop &lt; udiLength DO
1049
    IF pBuffer^ &lt;&gt; pSearch^ THEN
1050
        udiLoop := udiLoop + 1;
1051
        pBuffer := pStrBuf + udiLength - udiLoop;
1052
        pSearch := ADR( sSearchString);
1053
        udiSearch := 0;
1054
    ELSE
1055
        udiSearch := udiSearch + 1;
1056
        pBuffer := pStrBuf + udiLength - udiLoop + udiSearch;
1057
        pSearch := ADR( sSearchString ) + udiSearch;
1058
    END_IF;
1059
END_WHILE;
1060
FindBack :=  udiLength - udiLoop + 1;</xhtml>
1061
                </ST>
1062
              </body>
1063
              <addData />
1064
            </Method>
1065
          </data>
1066
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1067
            <Method name="Set" ObjectId="59092938-ca22-4896-8f54-1c854a0bd883">
1068
              <interface>
1069
                <returnType>
1070
                  <BOOL />
1071
                </returnType>
1072
                <inputVars>
1073
                  <variable name="pbyAdr">
1074
                    <type>
1075
                      <pointer>
1076
                        <baseType>
1077
                          <BYTE />
1078
                        </baseType>
1079
                      </pointer>
1080
                    </type>
1081
                    <documentation>
1082
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> Set buffer adress (ADR ...)</xhtml>
1083
                    </documentation>
1084
                  </variable>
1085
                  <variable name="udiSize">
1086
                    <type>
1087
                      <UDINT />
1088
                    </type>
1089
                    <documentation>
1090
                      <xhtml xmlns="http://www.w3.org/1999/xhtml"> Set buffer size (SIZEOF ...)</xhtml>
1091
                    </documentation>
1092
                  </variable>
1093
                </inputVars>
1094
                <documentation>
1095
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> Sets the Buffer </xhtml>
1096
                </documentation>
1097
              </interface>
1098
              <body>
1099
                <ST>
1100
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">IF (pbyAdr = 0) OR (udiSize = 0) THEN
1101
    Set := FALSE;
1102
    RETURN;
1103
END_IF;
1104
1105
udiBufSize := udiSize;
1106
pStrBuf := pbyAdr;
1107
1108
Set := TRUE;</xhtml>
1109
                </ST>
1110
              </body>
1111
              <addData />
1112
            </Method>
1113
          </data>
1114
          <data name="http://www.3s-software.com/plcopenxml/property" handleUnknown="implementation">
1115
            <Property name="Append" ObjectId="ddd7c0b6-46f9-4fa9-946e-0da608268245">
1116
              <interface>
1117
                <returnType>
1118
                  <derived name="T_MaxString" />
1119
                </returnType>
1120
                <documentation>
1121
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> Appends a string to the buffer</xhtml>
1122
                </documentation>
1123
              </interface>
1124
              <SetAccessor>
1125
                <interface>
1126
                  <localVars>
1127
                    <variable name="pByteIn">
1128
                      <type>
1129
                        <pointer>
1130
                          <baseType>
1131
                            <BYTE />
1132
                          </baseType>
1133
                        </pointer>
1134
                      </type>
1135
                    </variable>
1136
                    <variable name="pByteBuffer">
1137
                      <type>
1138
                        <pointer>
1139
                          <baseType>
1140
                            <BYTE />
1141
                          </baseType>
1142
                        </pointer>
1143
                      </type>
1144
                    </variable>
1145
                  </localVars>
1146
                </interface>
1147
                <body>
1148
                  <ST>
1149
                    <xhtml xmlns="http://www.w3.org/1999/xhtml">pByteIn := ADR(Append); 
1150
pByteBuffer := pStrBuf + udiLength;
1151
1152
WHILE pByteIn^ &lt;&gt; 0 AND (udiLength &lt; udiBufSize ) DO
1153
    pByteBuffer^ := pByteIn^;
1154
    udiLength := udiLength + 1;
1155
    pByteIn := pByteIn + 1;
1156
    pByteBuffer := pByteBuffer + 1;
1157
END_WHILE;
1158
1159
pByteBuffer := pStrBuf + udiLength; (* String End *)
1160
pByteBuffer^ := 0; (* null terminated string *)
1161
</xhtml>
1162
                  </ST>
1163
                </body>
1164
                <addData />
1165
              </SetAccessor>
1166
              <addData />
1167
            </Property>
1168
          </data>
1169
          <data name="http://www.3s-software.com/plcopenxml/property" handleUnknown="implementation">
1170
            <Property name="BufferSize" ObjectId="879a667c-416e-4879-91ff-6641233ded93">
1171
              <interface>
1172
                <returnType>
1173
                  <UDINT />
1174
                </returnType>
1175
                <documentation>
1176
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> Read current Buffersize</xhtml>
1177
                </documentation>
1178
              </interface>
1179
              <GetAccessor>
1180
                <interface />
1181
                <body>
1182
                  <ST>
1183
                    <xhtml xmlns="http://www.w3.org/1999/xhtml">BufferSize := udiBufSize;</xhtml>
1184
                  </ST>
1185
                </body>
1186
                <addData />
1187
              </GetAccessor>
1188
              <addData />
1189
            </Property>
1190
          </data>
1191
          <data name="http://www.3s-software.com/plcopenxml/property" handleUnknown="implementation">
1192
            <Property name="Length" ObjectId="80c3b0fb-2bdc-4829-89c6-017e171b31eb">
1193
              <interface>
1194
                <returnType>
1195
                  <UDINT />
1196
                </returnType>
1197
              </interface>
1198
              <GetAccessor>
1199
                <interface />
1200
                <body>
1201
                  <ST>
1202
                    <xhtml xmlns="http://www.w3.org/1999/xhtml">Length := udiLength;</xhtml>
1203
                  </ST>
1204
                </body>
1205
                <addData />
1206
              </GetAccessor>
1207
              <SetAccessor>
1208
                <interface />
1209
                <body>
1210
                  <ST>
1211
                    <xhtml xmlns="http://www.w3.org/1999/xhtml">udiLength := Length;</xhtml>
1212
                  </ST>
1213
                </body>
1214
                <addData />
1215
              </SetAccessor>
1216
              <addData />
1217
            </Property>
1218
          </data>
1219
          <data name="http://www.3s-software.com/plcopenxml/property" handleUnknown="implementation">
1220
            <Property name="Prepend" ObjectId="c4fdd2db-7736-4bc5-a06f-ba3a29618794">
1221
              <interface>
1222
                <returnType>
1223
                  <derived name="T_MaxString" />
1224
                </returnType>
1225
                <documentation>
1226
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> Prepends a string to the buffer</xhtml>
1227
                </documentation>
1228
              </interface>
1229
              <SetAccessor>
1230
                <interface>
1231
                  <localVars>
1232
                    <variable name="TempBuf">
1233
                      <type>
1234
                        <string length="GVL_Param_XmlControl.MaxFileSize" />
1235
                      </type>
1236
                    </variable>
1237
                    <variable name="pTempBuf">
1238
                      <type>
1239
                        <pointer>
1240
                          <baseType>
1241
                            <BYTE />
1242
                          </baseType>
1243
                        </pointer>
1244
                      </type>
1245
                    </variable>
1246
                    <variable name="pByteIn">
1247
                      <type>
1248
                        <pointer>
1249
                          <baseType>
1250
                            <BYTE />
1251
                          </baseType>
1252
                        </pointer>
1253
                      </type>
1254
                    </variable>
1255
                    <variable name="pByteBuffer">
1256
                      <type>
1257
                        <pointer>
1258
                          <baseType>
1259
                            <BYTE />
1260
                          </baseType>
1261
                        </pointer>
1262
                      </type>
1263
                    </variable>
1264
                    <variable name="i">
1265
                      <type>
1266
                        <UDINT />
1267
                      </type>
1268
                    </variable>
1269
                  </localVars>
1270
                </interface>
1271
                <body>
1272
                  <ST>
1273
                    <xhtml xmlns="http://www.w3.org/1999/xhtml">//save current buffer to temporary buffer
1274
pByteBuffer := pStrBuf;
1275
1276
FOR i := 0 TO (udiBufsize-1) DO
1277
    TempBuf[i] := pByteBuffer[i];
1278
END_FOR
1279
1280
pByteIn := ADR(Prepend); 
1281
pByteBuffer := pStrBuf;
1282
1283
WHILE pByteIn^ &lt;&gt; 0 AND (udiLength &lt; udiBufSize ) DO
1284
    pByteBuffer^ := pByteIn^;
1285
    udiLength := udiLength + 1;
1286
    pByteIn := pByteIn + 1;
1287
    pByteBuffer := pByteBuffer + 1;
1288
END_WHILE;
1289
1290
pTempBuf := ADR(TempBuf);
1291
WHILE pTempBuf^ &lt;&gt; 0 AND (udiLength &lt; udiBufSize ) DO
1292
    pByteBuffer^ := pTempBuf^;
1293
    pTempBuf := pTempBuf + 1;
1294
    pByteBuffer := pByteBuffer + 1;
1295
END_WHILE;
1296
1297
pByteBuffer := pStrBuf + udiLength; (* String End *)
1298
pByteBuffer^ := 0; (* nul terminated string *)
1299
</xhtml>
1300
                  </ST>
1301
                </body>
1302
                <addData />
1303
              </SetAccessor>
1304
              <addData />
1305
            </Property>
1306
          </data>
1307
          <data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
1308
            <ObjectId>fbccbed5-94ee-455b-a9d5-e8b750ed732e</ObjectId>
1309
          </data>
1310
        </addData>
1311
      </pou>
1312
      <pou name="FB_XmlControl" pouType="functionBlock">
1313
        <interface>
1314
          <localVars>
1315
            <variable name="Buffer">
1316
              <type>
1317
                <derived name="FB_StreamBuffer" />
1318
              </type>
1319
            </variable>
1320
            <variable name="TagList">
1321
              <type>
1322
                <derived name="FB_StreamBuffer" />
1323
              </type>
1324
            </variable>
1325
            <variable name="sTags">
1326
              <type>
1327
                <derived name="T_MaxString" />
1328
              </type>
1329
            </variable>
1330
            <variable name="TagListSeek">
1331
              <type>
1332
                <derived name="FB_StreamBuffer" />
1333
              </type>
1334
            </variable>
1335
            <variable name="sTagsSeek">
1336
              <type>
1337
                <string />
1338
              </type>
1339
            </variable>
1340
            <variable name="Tag">
1341
              <type>
1342
                <derived name="FB_StreamBuffer" />
1343
              </type>
1344
            </variable>
1345
            <variable name="sTag">
1346
              <type>
1347
                <derived name="T_MaxString" />
1348
              </type>
1349
            </variable>
1350
            <variable name="xTagOpen">
1351
              <type>
1352
                <BOOL />
1353
              </type>
1354
            </variable>
1355
            <variable name="iSelect">
1356
              <type>
1357
                <UDINT />
1358
              </type>
1359
            </variable>
1360
            <variable name="iSelectStart">
1361
              <type>
1362
                <UDINT />
1363
              </type>
1364
            </variable>
1365
            <variable name="iSelectEnd">
1366
              <type>
1367
                <UDINT />
1368
              </type>
1369
            </variable>
1370
            <variable name="iSelectStartPara">
1371
              <type>
1372
                <UDINT />
1373
              </type>
1374
            </variable>
1375
            <variable name="iSelectEndPara">
1376
              <type>
1377
                <UDINT />
1378
              </type>
1379
            </variable>
1380
            <variable name="iSelectTagClose">
1381
              <type>
1382
                <UDINT />
1383
              </type>
1384
            </variable>
1385
            <variable name="iSelectStartValue">
1386
              <type>
1387
                <UDINT />
1388
              </type>
1389
            </variable>
1390
            <variable name="iSelectEndValue">
1391
              <type>
1392
                <UDINT />
1393
              </type>
1394
            </variable>
1395
            <variable name="udiSearchPos">
1396
              <type>
1397
                <UDINT />
1398
              </type>
1399
            </variable>
1400
          </localVars>
1401
          <localVars constant="true">
1402
            <variable name="TAG_OPEN">
1403
              <type>
1404
                <string length="1" />
1405
              </type>
1406
              <initialValue>
1407
                <simpleValue value="'&lt;'" />
1408
              </initialValue>
1409
            </variable>
1410
            <variable name="TAG_CLOSE">
1411
              <type>
1412
                <string length="1" />
1413
              </type>
1414
              <initialValue>
1415
                <simpleValue value="'&gt;'" />
1416
              </initialValue>
1417
            </variable>
1418
            <variable name="END_TAG_CLOSE">
1419
              <type>
1420
                <string length="4" />
1421
              </type>
1422
              <initialValue>
1423
                <simpleValue value="'/&gt;'" />
1424
              </initialValue>
1425
            </variable>
1426
            <variable name="SPACE">
1427
              <type>
1428
                <string length="1" />
1429
              </type>
1430
              <initialValue>
1431
                <simpleValue value="' '" />
1432
              </initialValue>
1433
            </variable>
1434
            <variable name="EQUALS">
1435
              <type>
1436
                <string length="1" />
1437
              </type>
1438
              <initialValue>
1439
                <simpleValue value="'='" />
1440
              </initialValue>
1441
            </variable>
1442
            <variable name="QUOTE">
1443
              <type>
1444
                <string length="1" />
1445
              </type>
1446
              <initialValue>
1447
                <simpleValue value="'&quot;'" />
1448
              </initialValue>
1449
            </variable>
1450
            <variable name="BACK_SLASH">
1451
              <type>
1452
                <string length="1" />
1453
              </type>
1454
              <initialValue>
1455
                <simpleValue value="'\'" />
1456
              </initialValue>
1457
            </variable>
1458
            <variable name="FORWARD_SLASH">
1459
              <type>
1460
                <string length="1" />
1461
              </type>
1462
              <initialValue>
1463
                <simpleValue value="'/'" />
1464
              </initialValue>
1465
            </variable>
1466
            <variable name="OPEN_COMMENT">
1467
              <type>
1468
                <string length="5" />
1469
              </type>
1470
              <initialValue>
1471
                <simpleValue value="'&lt;!-- '" />
1472
              </initialValue>
1473
            </variable>
1474
            <variable name="CLOSE_COMMENT">
1475
              <type>
1476
                <string length="4" />
1477
              </type>
1478
              <initialValue>
1479
                <simpleValue value="' --&gt;'" />
1480
              </initialValue>
1481
            </variable>
1482
            <variable name="TAB">
1483
              <type>
1484
                <string length="2" />
1485
              </type>
1486
              <initialValue>
1487
                <simpleValue value="'$T'" />
1488
              </initialValue>
1489
            </variable>
1490
            <variable name="CR_LF">
1491
              <type>
1492
                <string length="4" />
1493
              </type>
1494
              <initialValue>
1495
                <simpleValue value="'$R$N'" />
1496
              </initialValue>
1497
            </variable>
1498
          </localVars>
1499
          <documentation>
1500
            <xhtml xmlns="http://www.w3.org/1999/xhtml">
1501
Organizes parsing and composing of XML data. Data can be treated as STRING or char array.
1502
Filebuffersize is default 4096 bytes and can be set via Gvl_Param_XmlControl
1503
1504
Usage example:
1505
1506
1. Initiate
1507
    VAR
1508
        XML : FB_XMLControl;
1509
        Buffer: STRING(GVL_Param_XmlControl.udiMaxFileSize);
1510
        //or
1511
        Buffer: ARRAY [0..GVL_Param_XmlControl.udiMaxFileSize] OF BYTE;
1512
    END_VAR
1513
1514
        XML.pBuffer: = ADR (buffer);
1515
        XML.LenBuffer: = SIZEOF (buffer);
1516
1517
    Add your own preferred fileheader like so:
1518
    XML: &lt;?xml version="1.0" encoding="UTF-8"?&gt;
1519
   
1520
        XML.WriteDocumentHeader( '&lt;?xml version="1.0" encoding="UTF-8"?&gt;');
1521
1522
2. Compose a tag with a parameters:
1523
XML: &lt;MyTag ParaName = "11" /&gt;
1524
1525
    XML.newTag(sTagName: = 'MyTag');
1526
    XML.newPara(sName: = 'ParaName', sPara: = sValue);
1527
    XML.CloseTag();
1528
1529
1530
3. Add tag value:
1531
XML: &lt;MyTag&gt; MyText &lt;/ MyTag&gt;
1532
1533
    XML.newTag(sName := 'MyTag');
1534
    XML.newTagData(sTagData :='MyText');
1535
    XML.CloseTag();
1536
1537
1538
4. Jump to the beginning of the XML data
1539
XML.toStartBuffer();
1540
1541
1542
5. Add a comment:
1543
XML: &lt;!-- MyComment --&gt;
1544
1545
    XML.newComment(sTagName: = 'MyComment');
1546
1547
6. Returns the next tag from the current position in buffer
1548
XML.NextTag();
1549
1550
1551
7. Output the parameter of the tag
1552
XML.NextPara(sPara: = LastValue);
1553
Feedback: sPara returns the value found (string)
1554
1555
</xhtml>
1556
          </documentation>
1557
        </interface>
1558
        <body>
1559
          <ST>
1560
            <xhtml xmlns="http://www.w3.org/1999/xhtml" />
1561
          </ST>
1562
        </body>
1563
        <addData>
1564
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1565
            <Method name="NewTag" ObjectId="c44bdbda-725a-4943-a5cc-fa5ea9485541">
1566
              <interface>
1567
                <inputVars>
1568
                  <variable name="Name">
1569
                    <type>
1570
                      <derived name="T_MaxString" />
1571
                    </type>
1572
                  </variable>
1573
                </inputVars>
1574
                <documentation>
1575
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">
1576
    Creates a new Tag:
1577
    XML: &lt;MyTag&gt;
1578
1579
    XML.NewTag(Name: = 'MyTag');
1580
</xhtml>
1581
                </documentation>
1582
              </interface>
1583
              <body>
1584
                <ST>
1585
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">IF xTagOpen THEN
1586
    Buffer.Append := TAG_CLOSE;
1587
END_IF;
1588
Buffer.Append := TAG_OPEN;
1589
Buffer.Append := Name;
1590
xTagOpen := TRUE;
1591
TagList.Append := FORWARD_SLASH;
1592
TagList.Append := Name;</xhtml>
1593
                </ST>
1594
              </body>
1595
              <addData />
1596
            </Method>
1597
          </data>
1598
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1599
            <Method name="ClearBuffer" ObjectId="651b4460-232e-47e8-95ba-ecea1541fbb9">
1600
              <interface>
1601
                <documentation>
1602
                  <xhtml xmlns="http://www.w3.org/1999/xhtml"> 
1603
    Clears the contents of the entire buffer
1604
</xhtml>
1605
                </documentation>
1606
              </interface>
1607
              <body>
1608
                <ST>
1609
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">udiSearchPos := 0;
1610
TagListSeek.Length := 0;
1611
Buffer.Length := 0;
1612
sTagsSeek := '';
1613
sTag := '';</xhtml>
1614
                </ST>
1615
              </body>
1616
              <addData />
1617
            </Method>
1618
          </data>
1619
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1620
            <Method name="CloseTag" ObjectId="eedd2aac-2425-4325-8128-bfe1e984f3f7">
1621
              <interface>
1622
                <returnType>
1623
                  <derived name="T_MaxString" />
1624
                </returnType>
1625
                <documentation>
1626
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">
1627
    Closes a Tag:
1628
    XML: &lt;MyTag /&gt;'
1629
1630
    Method: XML.CloseTag();
1631
</xhtml>
1632
                </documentation>
1633
              </interface>
1634
              <body>
1635
                <ST>
1636
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">IF xTagOpen THEN
1637
    Buffer.Append := END_TAG_CLOSE;
1638
    iSelect := TagList.FindBack(sSearchString := FORWARD_SLASH);
1639
    CloseTag := TagList.CutOff(udiStartPos:= iSelect);
1640
    xTagOpen := FALSE;
1641
ELSE
1642
    iSelect := TagList.FindBack(sSearchString := FORWARD_SLASH);
1643
    CloseTag := TagList.CutOff(udiStartPos:= iSelect);
1644
    Buffer.Append := TAG_OPEN;
1645
    Buffer.Append := CloseTag;
1646
    Buffer.Append := TAG_CLOSE;
1647
END_IF</xhtml>
1648
                </ST>
1649
              </body>
1650
              <addData />
1651
            </Method>
1652
          </data>
1653
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1654
            <Method name="NewComment" ObjectId="0f41fa45-b92e-4e7e-b2b3-ecb5d5918326">
1655
              <interface>
1656
                <inputVars>
1657
                  <variable name="Comment">
1658
                    <type>
1659
                      <derived name="T_MaxString" />
1660
                    </type>
1661
                  </variable>
1662
                </inputVars>
1663
                <documentation>
1664
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">
1665
    Adds a comment;
1666
    XML: &lt;!-- MyComment --&gt;
1667
1668
    XML.NewComment(Comment: = 'MyComment');
1669
</xhtml>
1670
                </documentation>
1671
              </interface>
1672
              <body>
1673
                <ST>
1674
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">IF xTagOpen THEN
1675
    Buffer.Append := TAG_CLOSE;
1676
    xTagOpen := FALSE;
1677
END_IF;
1678
Buffer.Append := OPEN_COMMENT;
1679
Buffer.Append := Comment;
1680
Buffer.Append := CLOSE_COMMENT;</xhtml>
1681
                </ST>
1682
              </body>
1683
              <addData />
1684
            </Method>
1685
          </data>
1686
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1687
            <Method name="NewParameter" ObjectId="60c10606-ff09-4f9b-a3dd-0b54d0f565c7">
1688
              <interface>
1689
                <inputVars>
1690
                  <variable name="Name">
1691
                    <type>
1692
                      <derived name="T_MaxString" />
1693
                    </type>
1694
                  </variable>
1695
                  <variable name="Value">
1696
                    <type>
1697
                      <derived name="T_MaxString" />
1698
                    </type>
1699
                  </variable>
1700
                </inputVars>
1701
                <documentation>
1702
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">
1703
    Must be called after opening a new tag
1704
1705
    XML.NewParameter(Name: = 'ParaName', Value: = 'Value');
1706
</xhtml>
1707
                </documentation>
1708
              </interface>
1709
              <body>
1710
                <ST>
1711
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">Buffer.Append := SPACE;  
1712
Buffer.Append := Name;
1713
Buffer.Append := EQUALS; 
1714
Buffer.Append := QUOTE; 
1715
Buffer.Append := Value;
1716
Buffer.Append := QUOTE;</xhtml>
1717
                </ST>
1718
              </body>
1719
              <addData />
1720
            </Method>
1721
          </data>
1722
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1723
            <Method name="NewTagData" ObjectId="e4679d3f-10eb-47fd-936c-97e3aaaa3768">
1724
              <interface>
1725
                <inputVars>
1726
                  <variable name="Data">
1727
                    <type>
1728
                      <derived name="T_MaxString" />
1729
                    </type>
1730
                  </variable>
1731
                </inputVars>
1732
              </interface>
1733
              <body>
1734
                <ST>
1735
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">Buffer.Append := TAG_CLOSE;
1736
Buffer.Append := Data;
1737
xTagOpen := FALSE;</xhtml>
1738
                </ST>
1739
              </body>
1740
              <addData />
1741
            </Method>
1742
          </data>
1743
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1744
            <Method name="NextTag" ObjectId="d039b781-905d-4b69-b5aa-bb0323e598de">
1745
              <interface>
1746
                <returnType>
1747
                  <derived name="T_MaxString" />
1748
                </returnType>
1749
              </interface>
1750
              <body>
1751
                <ST>
1752
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">iSelectStart := Buffer.Find(sSearchString := TAG_OPEN, udiStartPos := udiSearchPos);
1753
iSelectEnd := Buffer.Find(sSearchString := TAG_CLOSE, udiStartPos := iSelectStart);
1754
iSelectStartPara := Buffer.Find(sSearchString := SPACE, udiStartPos := iSelectStart);
1755
iSelectTagClose := Buffer.Find(sSearchString := FORWARD_SLASH, udiStartPos := iSelectStart);
1756
IF iSelectStart &lt; Buffer.Length AND iSelectEnd &lt; Buffer.Length THEN
1757
    udiSearchPos := iSelectEnd;
1758
    sTag := Buffer.Copy( udiStart:= iSelectStart + 1, udiEnd:= iSelectEnd);
1759
    IF iSelectEnd &lt; iSelectStartPara THEN
1760
        NextTag := Buffer.Copy( udiStart:= iSelectStart + 1, udiEnd:= iSelectEnd);
1761
    ELSE
1762
        NextTag := Buffer.Copy( udiStart:= iSelectStart + 1, udiEnd:= iSelectStartPara);
1763
    END_IF;
1764
    IF iSelectTagClose = iSelectStart + 1 THEN
1765
        iSelect := TagListSeek.FindBack(sSearchString := FORWARD_SLASH);
1766
        TagListSeek.CutOff(udiStartPos:= iSelect);
1767
    ELSIF iSelectTagClose &gt; iSelectStart AND iSelectTagClose &lt; iSelectEnd THEN
1768
        TagListSeek.Append := FORWARD_SLASH;
1769
        TagListSeek.Append := NextTag;
1770
        iSelect := TagListSeek.FindBack(sSearchString := FORWARD_SLASH);
1771
        TagListSeek.CutOff(udiStartPos:= iSelect);
1772
    ELSE
1773
        TagListSeek.Append := FORWARD_SLASH;
1774
        TagListSeek.Append := NextTag;
1775
    END_IF;
1776
ELSE
1777
    udiSearchPos := Buffer.Length;
1778
    NextTag := '';
1779
END_IF;</xhtml>
1780
                </ST>
1781
              </body>
1782
              <addData />
1783
            </Method>
1784
          </data>
1785
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1786
            <Method name="ToStartBuffer" ObjectId="cb065068-a6c8-48d5-8c1d-535a21365348">
1787
              <interface>
1788
                <documentation>
1789
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">
1790
    Jump to the beginning of the XML data
1791
    XML.ToStartBuffer();
1792
</xhtml>
1793
                </documentation>
1794
              </interface>
1795
              <body>
1796
                <ST>
1797
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">udiSearchPos := 0;
1798
TagListSeek.Length := 0;
1799
sTagsSeek := '';
1800
sTag := '';</xhtml>
1801
                </ST>
1802
              </body>
1803
              <addData />
1804
            </Method>
1805
          </data>
1806
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1807
            <Method name="WriteDocumentHeader" ObjectId="14bf2549-9e7d-451f-8ab5-fe662eb30712">
1808
              <interface>
1809
                <inputVars>
1810
                  <variable name="Header">
1811
                    <type>
1812
                      <derived name="T_MaxString" />
1813
                    </type>
1814
                  </variable>
1815
                </inputVars>
1816
                <documentation>
1817
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">
1818
    Add your own preffered fileheader like:
1819
    XML: &lt;?xml version="1.0" encoding="UTF-8"?&gt;
1820
1821
    XML.WriteDocumentHeader('&lt;?xml version="1.0" encoding="UTF-8"?&gt;');
1822
</xhtml>
1823
                </documentation>
1824
              </interface>
1825
              <body>
1826
                <ST>
1827
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">//Buffer.Prepend := Concat(Header, CR_LF);
1828
Buffer.Prepend := Header;</xhtml>
1829
                </ST>
1830
              </body>
1831
              <addData />
1832
            </Method>
1833
          </data>
1834
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1835
            <Method name="NextParameter" ObjectId="4394d0a2-f7bc-4847-9625-00022c462a79">
1836
              <interface>
1837
                <returnType>
1838
                  <derived name="T_MaxString" />
1839
                </returnType>
1840
                <outputVars>
1841
                  <variable name="Parameter">
1842
                    <type>
1843
                      <derived name="T_MaxString" />
1844
                    </type>
1845
                  </variable>
1846
                </outputVars>
1847
                <localVars>
1848
                  <variable name="Name">
1849
                    <type>
1850
                      <derived name="T_MaxString" />
1851
                    </type>
1852
                  </variable>
1853
                </localVars>
1854
              </interface>
1855
              <body>
1856
                <ST>
1857
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">iSelectEndPara := Buffer.Find(sSearchString := EQUALS, udiStartPos := iSelectStartPara);
1858
IF iSelectStartPara &lt; iSelectEnd AND iSelectEndPara &lt; iSelectEnd THEN
1859
    Name := Buffer.Copy( udiStart := iSelectStartPara + 1, udiEnd := iSelectEndPara);
1860
    iSelectStartValue := Buffer.Find(sSearchString := QUOTE, udiStartPos := iSelectEndPara);
1861
    iSelectEndValue := Buffer.Find(sSearchString := QUOTE, udiStartPos := iSelectStartValue);
1862
    Parameter := Buffer.Copy( udiStart := iSelectStartValue + 1, udiEnd := iSelectEndValue);
1863
    iSelectStartPara := iSelectEndValue + 1;
1864
ELSE
1865
    iSelectEndValue := Buffer.Find(sSearchString := TAG_OPEN, udiStartPos := udiSearchPos);
1866
    Name := Buffer.Copy( udiStart := udiSearchPos + 1, udiEnd := iSelectEndValue); 
1867
END_IF;
1868
NextParameter := Name;</xhtml>
1869
                </ST>
1870
              </body>
1871
              <addData />
1872
            </Method>
1873
          </data>
1874
          <data name="http://www.3s-software.com/plcopenxml/method" handleUnknown="implementation">
1875
            <Method name="SetBuffer" ObjectId="cbfaa6d5-eab9-48d0-a339-a8bf334e344e">
1876
              <interface>
1877
                <inputVars>
1878
                  <variable name="pString">
1879
                    <type>
1880
                      <pointer>
1881
                        <baseType>
1882
                          <BYTE />
1883
                        </baseType>
1884
                      </pointer>
1885
                    </type>
1886
                  </variable>
1887
                  <variable name="iSizeOf">
1888
                    <type>
1889
                      <UDINT />
1890
                    </type>
1891
                  </variable>
1892
                </inputVars>
1893
              </interface>
1894
              <body>
1895
                <ST>
1896
                  <xhtml xmlns="http://www.w3.org/1999/xhtml">Buffer.Set(pbyAdr := pString, udiSize := iSizeOf);
1897
TagList.Set(pbyAdr := ADR(sTags), udiSize := SIZEOF(sTags));
1898
TagListSeek.Set(pbyAdr := ADR(sTagsSeek), udiSize := SIZEOF(sTagsSeek));
1899
Tag.Set(pbyAdr := ADR(sTag), udiSize := SIZEOF(sTag));</xhtml>
1900
                </ST>
1901
              </body>
1902
              <addData />
1903
            </Method>
1904
          </data>
1905
          <data name="http://www.3s-software.com/plcopenxml/property" handleUnknown="implementation">
1906
            <Property name="Length" ObjectId="4fdf30b6-5fe7-4452-ad0a-85e866e236d0">
1907
              <interface>
1908
                <returnType>
1909
                  <UDINT />
1910
                </returnType>
1911
              </interface>
1912
              <GetAccessor>
1913
                <interface />
1914
                <body>
1915
                  <ST>
1916
                    <xhtml xmlns="http://www.w3.org/1999/xhtml">Length := Buffer.Length;</xhtml>
1917
                  </ST>
1918
                </body>
1919
                <addData />
1920
              </GetAccessor>
1921
              <addData />
1922
            </Property>
1923
          </data>
1924
          <data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
1925
            <ObjectId>f48b7de2-5c07-4763-a8be-3d8ab3c1f58c</ObjectId>
1926
          </data>
1927
        </addData>
1928
      </pou>
1929
    </pous>
1930
  </types>
1931
  <instances>
1932
    <configurations />
1933
  </instances>
1934
  <addData>
1935
    <data name="http://www.3s-software.com/plcopenxml/globalvars" handleUnknown="implementation">
1936
      <globalVars name="GVL_System">
1937
        <variable name="_ST_Logger">
1938
          <type>
1939
            <derived name="ST_Log" />
1940
          </type>
1941
          <addData>
1942
            <data name="http://www.3s-software.com/plcopenxml/attributes" handleUnknown="implementation">
1943
              <Attributes>
1944
                <Attribute Name="hide" Value="" />
1945
              </Attributes>
1946
            </data>
1947
          </addData>
1948
        </variable>
1949
        <variable name="_CmpCfLog">
1950
          <type>
1951
            <derived name="CmpCfLog" />
1952
          </type>
1953
        </variable>
1954
        <addData>
1955
          <data name="http://www.3s-software.com/plcopenxml/attributes" handleUnknown="implementation">
1956
            <Attributes>
1957
              <Attribute Name="qualified_only" Value="" />
1958
              <Attribute Name="hide" Value="" />
1959
            </Attributes>
1960
          </data>
1961
          <data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
1962
            <ObjectId>7e465938-43b3-4ac5-bae5-c19fce2bd2bf</ObjectId>
1963
          </data>
1964
        </addData>
1965
      </globalVars>
1966
    </data>
1967
    <data name="http://www.3s-software.com/plcopenxml/globalvars" handleUnknown="implementation">
1968
      <globalVars name="GVL_Param_XmlControl" constant="true">
1969
        <variable name="MaxFileSize">
1970
          <type>
1971
            <UDINT />
1972
          </type>
1973
          <initialValue>
1974
            <simpleValue value="32767" />
1975
          </initialValue>
1976
          <documentation>
1977
            <xhtml xmlns="http://www.w3.org/1999/xhtml"> Maximum filesize in bytes (32 kb default)</xhtml>
1978
          </documentation>
1979
        </variable>
1980
        <variable name="FilePath">
1981
          <type>
1982
            <derived name="T_MaxString" />
1983
          </type>
1984
          <initialValue>
1985
            <simpleValue value="'c:/jenkins/workspace/XmlResultTester/testresult.xml'" />
1986
          </initialValue>
1987
          <documentation>
1988
            <xhtml xmlns="http://www.w3.org/1999/xhtml"> Filepath for testresult.xml, e.g.: c:/jenkins/workspace/XmlResultTester/testresult.xml</xhtml>
1989
          </documentation>
1990
        </variable>
1991
        <addData>
1992
          <data name="http://www.3s-software.com/plcopenxml/attributes" handleUnknown="implementation">
1993
            <Attributes>
1994
              <Attribute Name="parameterlist" Value="" />
1995
              <Attribute Name="qualified_only" Value="" />
1996
            </Attributes>
1997
          </data>
1998
          <data name="http://www.3s-software.com/plcopenxml/objectid" handleUnknown="discard">
1999
            <ObjectId>69588962-bd3e-4958-957e-7bfb94609af1</ObjectId>
2000
          </data>
2001
        </addData>
2002
      </globalVars>
2003
    </data>
2004
    <data name="http://www.3s-software.com/plcopenxml/interface" handleUnknown="implementation">
2005
      <Interface name="I_TestResultFormatter" ObjectId="fa75ee61-43fb-4767-8061-125a3a9e3424">
2006
        <Methods>
2007
          <Method name="Format" ObjectId="4eb108d9-22ef-4b8a-ba8b-39eb19e8c6ef">
2008
            <interface>
2009
              <inputVars>
2010
                <variable name="NumberOfTestSuites">
2011
                  <type>
2012
                    <UINT />
2013
                  </type>
2014
                  <documentation>
2015
                    <xhtml xmlns="http://www.w3.org/1999/xhtml"> The total number of test suites </xhtml>
2016
                  </documentation>
2017
                </variable>
2018
                <variable name="NumberOfTestCases">
2019
                  <type>
2020
                    <UINT />
2021
                  </type>
2022
                  <documentation>
2023
                    <xhtml xmlns="http://www.w3.org/1999/xhtml"> The total number of test cases (for all test function blocks) </xhtml>
2024
                  </documentation>
2025
                </variable>
2026
                <variable name="NumberOfSuccessfulTestCases">
2027
                  <type>
2028
                    <UINT />
2029
                  </type>
2030
                  <documentation>
2031
                    <xhtml xmlns="http://www.w3.org/1999/xhtml"> The total number of test cases that had all ASSERTS successful </xhtml>
2032
                  </documentation>
2033
                </variable>
2034
                <variable name="NumberOfFailedTestCases">
2035
                  <type>
2036
                    <UINT />
2037
                  </type>
2038
                  <documentation>
2039
                    <xhtml xmlns="http://www.w3.org/1999/xhtml"> The total number of test cases that had at least one ASSERT failed </xhtml>
2040
                  </documentation>
2041
                </variable>
2042
              </inputVars>
2043
              <outputVars>
2044
                <variable name="Busy">
2045
                  <type>
2046
                    <BOOL />
2047
                  </type>
2048
                </variable>
2049
              </outputVars>
2050
              <documentation>
2051
                <xhtml xmlns="http://www.w3.org/1999/xhtml"> Responsible for formatting the xml file skeleton
2052
  &lt;testsuites&gt;        =&gt; the aggregated result OF all xunit testfiles
2053
   &lt;testsuite&gt;       =&gt; the output from a single TestSuite
2054
     &lt;properties&gt;    =&gt; the defined properties at test execution
2055
       &lt;property&gt;    =&gt; name/value pair for a single property
2056
       ...
2057
     &lt;/properties&gt;
2058
     &lt;error&gt;&lt;/error&gt; =&gt; optional information, in place of a test case - normally if the tests in the suite could not be found etc.
2059
     &lt;testcase&gt;      =&gt; the results from executing a test method
2060
       &lt;system-out&gt;  =&gt; data written to System.out during the test run
2061
       &lt;system-err&gt;  =&gt; data written to System.err during the test run
2062
       &lt;skipped/&gt;    =&gt; test was skipped
2063
       &lt;failure&gt;     =&gt; test failed
2064
       &lt;error&gt;       =&gt; test encountered an error
2065
     &lt;/testcase&gt;
2066
     ...
2067
   &lt;/testsuite&gt;
2068
   ...
2069
 &lt;/testsuites&gt;</xhtml>
2070
              </documentation>
2071
            </interface>
2072
            <addData />
2073
          </Method>
2074
        </Methods>
2075
        <addData />
2076
      </Interface>
2077
    </data>
2078
    <data name="http://www.3s-software.com/plcopenxml/projectstructure" handleUnknown="discard">
2079
      <ProjectStructure>
2080
        <Object Name="prg_Example" ObjectId="917c49f4-3643-42fe-b791-ac2edc0df35b" />
2081
        <Folder Name="CmpLog">
2082
          <Object Name="FB_XmlFileFormatter" ObjectId="6597c0b3-0890-4d5d-8d3a-2d0d0b2355db">
2083
            <Object Name="Format" ObjectId="b6b6021c-eac1-4ed2-91cd-9954fbe29c28" />
2084
            <Object Name="FB_Init" ObjectId="0f23c47b-7245-415e-b489-0ae429217263" />
2085
            <Object Name="OpenSaveAndClose" ObjectId="bdefa095-3448-4b85-b486-ff4d5205677b" />
2086
          </Object>
2087
          <Object Name="I_TestResultFormatter" ObjectId="fa75ee61-43fb-4767-8061-125a3a9e3424">
2088
            <Object Name="Format" ObjectId="4eb108d9-22ef-4b8a-ba8b-39eb19e8c6ef" />
2089
          </Object>
2090
          <Object Name="GVL_System" ObjectId="7e465938-43b3-4ac5-bae5-c19fce2bd2bf" />
2091
        </Folder>
2092
        <Object Name="E_XmlError" ObjectId="05a4fdda-1086-47b5-ad10-7c2bac568355" />
2093
        <Folder Name="FileControl">
2094
          <Documentation>
2095
            <xhtml xmlns="http://www.w3.org/1999/xhtml">Imported from XML parsing and composing library (xml-pac) 0.3.1.0</xhtml>
2096
          </Documentation>
2097
          <Object Name="FB_FileControl" ObjectId="c9bec8fc-2de3-45f4-b839-e6c4276a6b5a">
2098
            <Object Name="Close" ObjectId="519e9011-283c-40b1-afd4-31686c5b81fe" />
2099
            <Object Name="Open" ObjectId="1873bb2c-c6a3-4681-8948-02aa2bad0a9b" />
2100
            <Object Name="Read" ObjectId="3984ae50-1cdb-4045-af99-0bb56917afb2" />
2101
            <Object Name="Save" ObjectId="c4146a99-50c6-4ce0-88ab-794dbfb1af62" />
2102
          </Object>
2103
        </Folder>
2104
        <Object Name="GVL_Param_XmlControl" ObjectId="69588962-bd3e-4958-957e-7bfb94609af1" />
2105
        <Folder Name="StreamBuffer">
2106
          <Object Name="FB_StreamBuffer" ObjectId="fbccbed5-94ee-455b-a9d5-e8b750ed732e">
2107
            <Object Name="Append" ObjectId="ddd7c0b6-46f9-4fa9-946e-0da608268245" />
2108
            <Object Name="BufferSize" ObjectId="879a667c-416e-4879-91ff-6641233ded93" />
2109
            <Object Name="Clear" ObjectId="5f0bbce2-2600-4a2e-8c6f-4b957ad03395" />
2110
            <Object Name="Copy" ObjectId="b796dd60-63f5-4b75-acc5-8fa40e24be46" />
2111
            <Object Name="CutOff" ObjectId="8914e4f8-8b6c-48c3-ba1f-e0642038624a" />
2112
            <Object Name="Find" ObjectId="7e38490a-9555-451d-957e-fef284a567e3" />
2113
            <Object Name="FindBack" ObjectId="7d08b204-2078-4fde-81eb-e04d71986196" />
2114
            <Object Name="Length" ObjectId="80c3b0fb-2bdc-4829-89c6-017e171b31eb" />
2115
            <Object Name="Prepend" ObjectId="c4fdd2db-7736-4bc5-a06f-ba3a29618794" />
2116
            <Object Name="Set" ObjectId="59092938-ca22-4896-8f54-1c854a0bd883" />
2117
          </Object>
2118
        </Folder>
2119
        <Object Name="T_MaxString" ObjectId="a429e267-db3b-4872-871e-1ca509b971e2" />
2120
        <Folder Name="XmlControl">
2121
          <Documentation>
2122
            <xhtml xmlns="http://www.w3.org/1999/xhtml">Imported from XML parsing and composing library (xml-pac) 0.3.1.0</xhtml>
2123
          </Documentation>
2124
          <Object Name="FB_XmlControl" ObjectId="f48b7de2-5c07-4763-a8be-3d8ab3c1f58c">
2125
            <Object Name="NewTag" ObjectId="c44bdbda-725a-4943-a5cc-fa5ea9485541" />
2126
            <Object Name="ClearBuffer" ObjectId="651b4460-232e-47e8-95ba-ecea1541fbb9" />
2127
            <Object Name="CloseTag" ObjectId="eedd2aac-2425-4325-8128-bfe1e984f3f7" />
2128
            <Object Name="Length" ObjectId="4fdf30b6-5fe7-4452-ad0a-85e866e236d0" />
2129
            <Object Name="NewComment" ObjectId="0f41fa45-b92e-4e7e-b2b3-ecb5d5918326" />
2130
            <Object Name="NewParameter" ObjectId="60c10606-ff09-4f9b-a3dd-0b54d0f565c7" />
2131
            <Object Name="NewTagData" ObjectId="e4679d3f-10eb-47fd-936c-97e3aaaa3768" />
2132
            <Object Name="NextTag" ObjectId="d039b781-905d-4b69-b5aa-bb0323e598de" />
2133
            <Object Name="ToStartBuffer" ObjectId="cb065068-a6c8-48d5-8c1d-535a21365348" />
2134
            <Object Name="WriteDocumentHeader" ObjectId="14bf2549-9e7d-451f-8ab5-fe662eb30712" />
2135
            <Object Name="NextParameter" ObjectId="4394d0a2-f7bc-4847-9625-00022c462a79" />
2136
            <Object Name="SetBuffer" ObjectId="cbfaa6d5-eab9-48d0-a339-a8bf334e344e" />
2137
          </Object>
2138
        </Folder>
2139
      </ProjectStructure>
2140
    </data>
2141
  </addData>
2142
</project>