FB_LON_KL6401

FB_LON_KL6401 1:

This function block is used for sending / receiving LON SNVTs via Bus Terminal KL6401. An instance of this function block is required for each terminal. One instance can send or receive up to 62 SNVTs.

The FB must be bound to the send/receive blocks via the VAR_IN_OUT structure stLON_Com.

FB_LON_KL6401 2:

Restrictions

  • Only one call per instance
  • Call must be made once per PLC cycle
  • Instance must be called in the same PLC task as the send and receive blocks assigned to it

VAR_INPUT

bResetMaxBuffer      : BOOL;
bDisabled            : BOOL := FALSE;

bResetMaxBuffer: Deletes the value rMaxBuffer for the maximum utilization of the send buffer.

bDisabled: TRUE = disables the function block.

VAR_OUTPUT

bReady           : BOOL;
bBusy            : BOOL;
bTimeOut         : BOOL;
bError           : BOOL;
eError           : E_LON_ERROR;
dwErrorKL        : DWORD;
byLONState       : BYTE;
stKL6401         : ST_KL6401;
arrNeuronID      : ARRAY [0..5] OF BYTE;
arrProgID        : ARRAY [0..7] OF BYTE;
wFW              : WORD;
byActBuffer      : BYTE;
rActBuffer       : REAL;
rMaxBuffer       : REAL;

bReady: Initialization is ready.

bBusy: If the sending of data is in process, this output will be TRUE.

bTimeOut: Timeout while Init.

bError: The output becomes TRUE as soon as an error occurs. The error is described via the variable eError.

eError: The output issues an error code when an error occurs (see E_LON_ERROR). Simultaneously bError is TRUE.

dwErrorKL: Error identifier of the function block. In this case the variable eError is set to "eKL6401_Error". Simultaneously bError is TRUE.

byLONState: LON state.

stKL6401: Structure for configuration (for future applications) (see ST_KL6401).

arrNeuronID: Displaying the Neuron-ID of the terminal (will not be supported until FW 4C).

arrProgID: Displaying the Program-ID of the terminal (will not be supported until FW 4C).

wFW: Displaying the Firmware-version of the terminal (will not be supported until FW 4C).

byActBuffer: Number of orders in the send buffer.

rActBuffer: Current utilization of the send buffer in percent.

rMaxBuffer: Maximum utilization of the send buffer in percent. The value can be deleted using the input variable bResetMaxBuffer.

VAR_IN_OUT

stParameter_IN       : ST_LON_Parameter_IN_36B;
stParameter_OUT      : ST_LON_Parameter_OUT_36B;
stLON_Com            : ST_LON_Communication;

stParameter_IN: Input variable of the terminal (see ST_LON_Parameter_IN_36B).

stParameter_OUT: Output variable of the terminal (see ST_LON_Parameter_OUT_36B).

stLON_Com: This structure connects the function block with the send/receive function blocks (see ST_LON_Communication). The send and receive is done by this function block. The send/receive function blocks have only the task to prepare/evaluate the data.