FB_LicFileRead
The function block reads a file from the license dongle into a provided buffer (pDestBuff and cbReadLen) via a rising edge at bExecute. The buffer must be large enough for the file, otherwise only the first part of the file is read.
Inputs
VAR_INPUT
sNetId : T_AmsNetId;
nPort : UINT;
sFileName : STRING;
pDestBuff : PVOID;
cbReadLen : UDINT
bExecute : BOOL;
dwPassCode : DWORD;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
Name | Type | Description |
---|---|---|
sNetId | T_AmsNetId | AmsNetId (AMS network ID) of the license dongle
|
nPort | UINT | AMS port of the license dongle
|
sFileName | STRING | Name of the file to be read |
pDestBuff | PVOID | Buffer address for read |
cbReadLen | UDINT | Count of bytes for read |
bExecute | BOOL | The function block is enabled by a positive edge at this input. |
dwPassCode | DWORD | Passcode for file access |
tTimeout | TIME | Time-out period that must not be exceeded when the command is executed. |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrorId : UDINT;
cbBytesread : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
bBusy | BOOL | When the function block is enabled, this output is set and remains set until a feedback is received. |
bError | BOOL | If an error occurs during the transmission of the command, this output is set after the bBusy output is reset. |
nErrorId | UDINT | Returns the ADS error number when the bError output is set. |
cbBytesRead | UDINT |
|
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.4022 | PC or CX (x64, x86) | Tc2_Utilties >= 3.3.26.0 |