Function block FB_KM6551_MASTERBROADCAST_10BYTE

This function block takes care of communication to the individual slaves in broadcast mode. The number of data telegrams can be reduced with the time tPolling. Data will then only be sent within the time tPolling. If the tPolling time is high for the broadcast slaves, make sure that you also enter a higher watchdog time, as otherwise the slave will display a watchdog error. A positive edge on bStart activates communication. If the bError bit is TRUE, an error has occurred. A precise error cause can be read out in iErrorID. ptData_OUT is a pointer address for the input data (ADR command to determine the pointer address) and iLenData_OUT is the length of the data. The length can be determined with SIZEOF and must not be larger than 10 bytes. The strLinkData variable is linked to the FB_KM6551_MAIN function block (the variable has exactly the same name). The FB_KM6551_MAIN function block should be finished before the FB_KM6551_MASTER_10BYTE function block is called, (see bActive in this function block).

Function block FB_KM6551_MASTERBROADCAST_10BYTE 1:
Function block FB_KM6551_Masterbroadcast_10Byte

VAR_INPUT

bStart
:BOOL;
iSlaveAddr
:INT;
strLinkData
:KM6551_Data;
ptData_OUT
:DWORD;
iLenData_OUT :INT;
tPolling
:TIME;

Key

bStart: A positive edge activates the function block.
iSlaveAddr: The address of the slave is entered here (see DIP switch on your slave module)
strLinkData: Is linked with strLinkData from FB_KM6551_MAIN.
ptData_OUT
: Pointer to the variable into which the master terminal should transmit to the slave (pointer address is determined with ADR(Variable_name)).
iLenData_OUT
: Length of the variable (the length can be determined with SIZEOF (variable_name))
tPolling: Time cycle in which the data should be sent to the slaves.

VAR_OUTPUT

bError
:BOOL;
bActive
:BOOL;
iErrorID
:E_KM6551_ERRORID;
E_Addr
:E_KM6551_DIP;

Key

b Error: The function block has an error.
bActive: Indicates whether or not the function block is working.
iErrorID
: Contains the error code.
E_Addr: Reads out the DIP switch setting of the KM6551-0000 and displays it.