XMLGetElementAsync (FB)¶
FUNCTION_BLOCK XMLGetElementAsync EXTENDS CBM.ETrig
Reads a xml element from file asynchronously, i.e. distributed on several cycles. This function block should be used to get elements of large xml files. To read from file set sFileName to file path and paDataArray = 0. To read from data array set sFileName = ‚‘ and paDataArray to data pointer.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xExecuteBOOLRising 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
xDoneBOOLTRUE: Action successfully completedETrig
xBusyBOOLTRUE: Function block activeETrig
xErrorBOOLTRUE: Error occurred, function block aborts actionFALSE: No errorETrig
Input
sFileNameSTRING(255)Path to a file
udiStartPositionUDINTStart position in file to read elements. Use XMLElement.udiPosition´
readModeRead mode
paElementsPOINTER TO XMLElement
Pointer to the result set
udiMaxElementsUDINTMaximum size of paElements
xTruncateValuesBOOLFALSE
true: All values that exceed the maximum value size will be truncated
paDataArrayPOINTER TO BYTE
0
Pointer to XML data array, if 0 read from file (sFileName)
udiDataArraySizeUDINT0
Size of paDataArray
Output
eErrorError code if xError is true
eLastErrorThe last error
udiCountElementsUDINTNumber of elemnents in paElements#
udiNextReadPosUDINTPosition in file (in bytes) of the next xml element, 0 if last element
eEncodingEncoding of the xml file