FB_LicFileRead 1:

The function block reads a file from the license dongle to a buffer (pDestBuff and cbReadLen) via a positive edge at bExecute. The buffer must be large enough for the file, otherwise only the first part of the file is read.


    sNetId      : T_AmsNetId;
    nPort       : UINT;
    sFileName   : STRING;
    pDestBuff   : PVOID;
    cbReadLen   : UDINT
    bExecute    : BOOL;
    dwPassCode  : DWORD;
    tTimeout    : TIME       := DEFAULT_ADS_TIMEOUT;

sNetId: AmsNetId (AMS network identifier) of the license dongle (type: T_AmsNetId)

nPort: AMS port of the license dongle

sFileName: Name of the file to be read

pDestBuff: Buffer address for read

cbReadLen: Count of bytes for read

bExecute: The function block is activated by a positive edge at this input.

dwPassCode: Passcode for file access

tTimeout: Timeout time that must not be exceeded when the command is executed.


    bBusy    : BOOL;
    bError   : BOOL;
    nErrorId : UDINT;

bBusy: TRUE, as long as the function block is active.

bError: TRUE if an error occurs during command execution.

nErrorId: Supplies the ADS error number when the bError output is set.


Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4022

PC or CX (x64, x86)

Tc2_Utilties >=