XMLWriteAsync (FB)¶
FUNCTION_BLOCK XMLWriteAsync EXTENDS CBM.ETrig
Writes a xml file asynchronously, i.e. distributed on several cycles. This function block should be used to write large xml files. To write to file set sFileName to file path and paDataArray = 0. To write to data array set sFileName = ‘’ and paDataArray to data pointer.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xExecute
BOOL
Rising edge: Action startsFalling edge: Resets outputsIf a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values (xDone
,xError
) are present at the outputs for exactly one cycle.ETrig
Output
xDone
BOOL
TRUE
: Action successfully completedETrig
xBusy
BOOL
TRUE
: Function block activeETrig
xError
BOOL
TRUE
: Error occurred, function block aborts actionFALSE
: No errorETrig
Input
sFileName
STRING(255)
Path to a file
paElements
POINTER TO XMLElement
Pointer to the result set
udiCountElements
UDINT
Number elements in paElements
eEncoding
File encoding
paDataArray
POINTER TO BYTE
0
Pointer to XML data array, if 0 write to file (sFileName)
udiDataArraySize
UDINT
0
Size of paDataArray
xAddDeclaration
BOOL
TRUE
Adds XML declaration with encoding info like ‘<?xml version=”1.0” encoding=..’, default: TRUE
Output
eError
Error code if xError is true
eLastError
The last error