FB_SetLedColorEx_BAPI

FB_SetLedColorEx_BAPI 1:
FB_SetLedColorEx_BAPI 2:

This functionality is only available on IPCs and Embedded PCs with a Usr-LED and with a BIOS version which supports the BIOS-API.

The function block FB_SetLedColorEx_BAPI can be used to switch the user LEDs (USR, U1 or U2) on PCs and embedded PCs with BIOS API support. The LED color is switched via a rising edge at bExecute and the eNewColor parameter. The LED can be switched off (eNewColor = eUsrLED_Off) or set to red (eNewColor = eUsrLED_Red), blue (eNewColor = eUsrLED_Blue) or green (eNewColor = eUsrLED_Green).

FB_SetLedColorEx_BAPI 3: Inputs

VAR_INPUT
    sNetID         : T_AmsNetID;
    nLedID         : USINT
    eNewColor      : E_UsrLED_Color;
    bExecute       : BOOL;
    tTimeout       : TIME;
END_VAR

Name

Type

Description

sNetID

T_AmsNetID

AMS network ID of the device (empty string or local network ID) (type T_AmsNetID)

nLedID

USINT

ID for the selection of the user LED: For devices with only one USR LED, the USR LED is selected via nLedID = 0 (default value is 0). For devices with several user LEDs, the U1 LED is selected via nLedID = 1 or the U2 LED via nLedID = 2.

eNewColor

E_UsrLED_Color

New LED color (type E_UsrLED_Color)

bExecute

BOOL

The command is executed with a rising edge. The input must be reset as soon as the function block is no longer active (bBusy=FALSE).

tTimeout

TIME

Time until the internal ADS communication is aborted.

FB_SetLedColorEx_BAPI 4: Outputs

VAR_OUTPUT
    bBusy    : BOOL;
    bError   : BOOL;
    nErrID   : UDINT;
END_VAR

Name

Type

Description

bBusy

BOOL

TRUE, as long as the function block is active.

bError

BOOL

TRUE if an error occurs during command execution.

nErrID

UDINT

Contains the ADS error code or the command-specific error code of the last executed command. Is reset to 0 by the execution of a command at the inputs.

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_System (system) v3.6.1