Function block FB_KM6551_MAIN

This function block takes care of communication to the KM6651-0000 and takes care of and makes settings in the module by means of register communication. Only one FB_KM6551_MAIN function block is permitted per KM6551-0000.

Function block FB_KM6551_MAIN 1:
Function block FB_KM6551_MAIN

VAR_INPUT

bActivate
:BOOL;
bBroadcast
:BOOL;
iChannel_Set
:INT;
uiSlaveTM
:UINT;
KM6551_IN
:ARRAY[1..12] of BYTE;
KM6551_OUT
:ARRAY[1..12] of BYTE;

Key

bActivate: Positive edge activates the function block and writes parameters to the KM6551-0000.
bBroadcast: Can only be activated in master mode. TRUE – sets the KM6651-0000 to broadcast master mode (see register 39).
iChannel_Set: The IEEE 802.15.4 channel is set here. Permitted values 0..15 (see register 32/33).
uiSlaveTM: Only usable in slave mode; setting of the watchdog for the slave mode (see register 38).
KM6551_IN
: Is connected to the INPUT data of the KM6551-0000.
KM6551_OUT: Is connected to the OUTPUT data of the KM6551-0000.

VAR_OUTPUT

bActive
:BOOL;
bError
:BOOL;
iErrorID
:E_KM6551_ERRORID;
bBusy
:BOOL;
strLinkData       :KM6551_Data;

Key

b Active: The function block has successfully transmitted the parameters to KM6551-0000 and can now commence data communication with the other KM6551-0000 function blocks.
bError: The function block has an error.
iErrorID: Contains the error code.
bBusy: The function block is still working as long as bBusy is set, i.e. is TRUE; wait until bBusy changes to FALSE.
strLinkData
: Data required by the higher-level function blocks. Connect this data to the additional function blocks that they call.