FB_FileProperties
This function block outputs the file properties of a selected file.
VAR_INPUT
VAR_INPUT
sNetID : T_AmsNetID;
sPathName : T_MaxString;
bExecute : BOOL;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
sNetID: Here you can enter a string with the network address of the TwinCAT computer whose directory is to be searched (type: T_AmsNetID). If it is to be run on the local computer, an empty string can be entered.
sPathName: Here the complete file path including file name and file extension is specified as a string (type: T_MaxString).
bExecute: The function block is activated by a positive edge at this input.
tTimeout: States the length of the timeout that may not be exceeded by execution of the ADS command.
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrId : UDINT;
stProperties : ST_FindFileEntry;
END_VAR
bBusy: When the function block is activated this output is set. It remains set until a feedback is received.
bError: In the event of an error during the command transfer, this output is set once the bBusy output has been reset.
nErrId: Supplies the ADS error number when the bError output is set.
stProperties: If the search was successful, this structure variable returns information on the file that was found (type: ST_FindFileEntry).
Requirements
Development environment | Target platform | PLC libraries to be integrated (category group) |
---|---|---|
TwinCAT v3.1.0 | PC or CX (WES7/Win7/Win10: TC RT x86/x64, WEC6/7: TC RT x86, WEC7: TC CE7 ARMV7, TC/BSD: TC RT x64, TC OS ARMT2) | Tc2_Utilities (System) |