FB_KL8548
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;
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.
dwOpt: For future options.
VAR_OUTPUT
bBusy : BOOL;
bStaSwiAuto : BOOL;
wStaPoti : WORD;
wStaOut : 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.
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).