MP_Addressing

MP_Addressing 1:

This function block allows an MP-Bus slave to be addressed. It is also possible to use this function block to read the serial number of the slave.
The slave address that the slave is to receive when addressed, or of the bus device whose serial number is to be read, is passed in MP_Address. The serial number is read out on a rising edge of bReadAddr. It is output through MP_Serial_Numer_Out. A rising edge of bAddrAuto addresses a slave whose address is MP_Address. The block waits for the time set in TMOUT for the transmission of the slave with its serial number. Transmission of the serial number is initiated differently from one slave to another. Please see the documentation for the MP-Bus device for how the serial number can be sent (in most cases there is a switch on the drive which will trigger this action when pressed). No telegrams are sent to the slaves during the time specified by TMOUT.

A rising edge at bAddrManual initiates manual addressing. This requires the serial number of the drive to be stored in MP_Serial_Number_In. The serial number of the slave can be found on an adhesive label on the drive.

Example: 00234-00016-002-031 The following must be entered in the MP_Serial_Numer_IN variable:

YearAndWeek = 234

DayAndNumber = 16

DeviceFamily = 2

TestStation = 31

FamilySuffix = is not evaluated, and should therefore be ignored.

bBusy is set for as long as the block is active. An error is indicated through bError, while the error number can be read with iErrorId.

VAR_INPUT

MP_Address            : USINT := 1;
bAddrAuto             : BOOL;
bReadAddr             : BOOL;
bAddrManual           : BOOL;
MP_Serial_Number_IN   : MP_Serial_Number;
TMOUT                 : TIME := t#30s;
strDataKL6771         : DataKL6771;

MP_Address: the MP address that is to be used for the addressing or for reading the serial number. Valid values (1...8).

bAddrAuto: a positive edge starts the function block. The function block halts other MP-Bus communication, and waits until the time set through TMOUT has elapsed for an MP-Bus slave has transmitted its serial number, for instance in response to pressing a switch. The MP-Bus address that has been configured in the MP_Address variable is then transmitted to the slave.

bReadAddr: a positive edge starts the function block. The function block reads the serial number of the MP-Bus slave whose address is MP_Address.

bAddrManual: a positive edge starts the function block. The function block addresses the slave that has serial number MP_Serial_Number_IN. The slave's addresses configured with MP_Address.

MP_Serial_Number_IN: serial number of the device (see MP_Serial_Number).

TMOUT: time after which automatic addressing is canceled.

strDataKL6771: the data structure with which the KL6771 function block must be linked (see DataKL6771).

VAR_OUTPUT

bBusy                 : BOOL;
bError                : BOOL;
iErrorId              : MP_Error;
MP_Serial_Number_OUT  : MP_Serial_Number;

bBusy: This bit is set for as long as the block is active.

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

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

MP_Serial_Number_OUT: The serial number of the slave that is addressed or interrogated (see MP_Serial_Number).