FB_KL8548Ex

FB_KL8548Ex 1:
Function block FB_KL8548Ex

Application

This function block is used to configure the KL8548, to read out the digital signals and to set the outputs/LEDs.

The function block must be called once per cycle.

The parameters are transferred to the terminal with a positive edge on bExecCfg.

The standard function of the LEDs cannot be deactivated.

VAR_INPUT

bEn             : BOOL;
bExecCfg        : BOOL;
bDisWatchdog    : BOOL;
bEnEcoMode      : BOOL;
bEnPwrOnVal     : BOOL;
wPwrOnVal       : WORD;
wOut            : WORD;
bDisManMode     : BOOL;
dwOpt           : DWORD;

bEn: The function block is enabled by setting bEn to TRUE in the PLC program. With bEn = FALSE the execution of the function block will be stopped and all outputs reset.

bExecCfg: The configurations bDisWatchdog, bEnEcoMode, bEnPwrOnVal and wPwrOnVal are written to the terminals when a positive edge is encountered. bBusy goes TRUE. Note that the inputs are not updated during this time.

bDisWatchdog: Configuration: If False the last value of wStaOut remains unchanged in the event of a K-bus error (the value is set to 0 if the PLC stops). If True and bEnPwrOnVal =False, the output goes to 0 in the event of a K-bus error (or PLC stopped). If True and bEnPwrOnVal =True, the output adopts the value of wPwrOnVal in the event of a K-bus error (or PLC stopped).

bEnEcoMode: Configuration: Full Scale Mode or ECO Mode. TRUE: ECO Mode. FALSE: Full Scale Mode.

bEnPwrOnVal: Configuration: TRUE: In the event of a K-bus error (or PLC stopped), the analog output is set to the value of wPowerOnValue if bDisWatchdog = True.

wPwrOnVal: Configuration: Value that the output is to adopt in the event of a K-bus error (or PLC stopped).

wOut: Value of the analog output signal, provided that the switch is set to "auto". 0 V = 0000hex = 0dec , 10 V = 7FFFhex = 32767dec. If the switch is set to "man" the value of the potentiometer is output.

bDisManMode: Disabling manual operating mode.

dwOpt: For future options.

VAR_OUPUT

bBusy           : BOOL;
bStaSwiAuto     : BOOL;
wStaPoti        : WORD;
wStaOut         : WORD;
bManModelsDis   : BOOL;
wFirmVer        : WORD;
bErr            : BOOL;
udiErrID        : UDINT;

bBusy: bBusy is TRUE as long as the configuration is being written (start with bExecCfg). Note that the inputs are not updated during this time.

bStaSwiAuto: Status of the switch. True ="auto" False = "man".

wStaPoti: Status of the potentiometer. CCW stop = 0000hex = 0dec = 0 V, CW stop = 7FFFhex = 32767dec = 10 V

wStaOut: Status of the analog output signal. CCW stop = 0000hex = 0dec = 0 V, CW stop = 7FFFhex = 32767dec = 10 V

bManModelsDis: Manual operating mode disabled.

wFirmVer: Issues the firmware version.

bErr: The bError output goes TRUE as soon as an error occurs. This error is described via the udiErrID variable.

udiErrID: In the event of an error the output issues an error code (see error codes). bError goes TRUE at the same time.

VAR_IN_OUT

stInData      : ST_KL8548InData;
stOutData     : ST_KL8548OutData;

stInData: Process image of the inputs (see ST_KL8548InData).

stOutData: Process image of the outputs (see ST_KL8548OutData).