FB_LicFileGetStorageInfo

FB_LicFileGetStorageInfo 1:

The function block reads the StorageInfo of the license dongle and the file directory.

The StorageInfo contains administrative data of the data carrier (such as capacity, number of free bytes, number of files,…) and an array of the individual file entries (name, size, attributes,… of the file).

FB_LicFileGetStorageInfo 2: Inputs

VAR_INPUT
    sNetId      : T_AmsNetId;
    nPort       : UINT;
    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

  • USB dongle: AmsNetId of the TwinCAT computer. For the local computer an empty string may be specified.
  • EL6070: AmsNetId of the EtherCAT master (see AdsAddr.netId in the InfoData of the EL6070)

nPort

UINT

AMS port of the license dongle

  • USB: ADS port of the ESB device (see ADS port on the ESB device tab of the USB dongle; the default is 16#7100)
  • EL6070: ADS port of the EtherCAT Terminal (see AdsAddr.port in the InfoData of the EL6070)

bExecute

BOOL

The function block is enabled by a positive edge at this input.

dwPassCode

DWORD

Passcode for file access (only for specially protected files)

tTimeout

TIME

Time-out period that must not be exceeded when the command is executed.

FB_LicFileGetStorageInfo 3: Inputs/outputs

VAR_IN_OUT
    stStorageInfo : ST_LicStorageInfo;
END_VAR

Name

Type

Description

stStorageInfo

ST_LicStorageInfo

StorageInfo of the license dongle

FB_LicFileGetStorageInfo 4: Outputs

VAR_OUTPUT
    bBusy        : BOOL;
    bError       : BOOL;
    nErrorId     : UDINT;
    nFileEntries : 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.

nFileEntries

UDINT

Number of files on the license dongle

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4022

PC or CX (x64, x86)

Tc2_Utilties >= 3.3.26.0