FB_SMIDiscoverySlaveId

FB_SMIDiscoverySlaveId 1:

The first drive is sought that corresponds to the specified manufacturer code and has the address 0. This function block is used in the addressing of SMI devices and is used in the FB_SMIAddressing block.

VAR_INPUT

bStart                  : BOOL;
bCancel                 : BOOL;
byManufacturer          : BYTE := 0;
dwOptions               : DWORD := 0;

bStart: the function block is activated, and the search is started by applying a positive edge to this input.

bCancel: the function block is deactivated and the search is aborted on applying a positive edge to this input.

byManufacturer: the manufacturer code specified for the search for the SMI device. Some SMI devices do not permit the manufacturer code 0.

dwOptions: reserved for future expansions.

VAR_OUTPUT

bBusy                                 : BOOL;
bError                                : BOOL;
udiErrorId                            : UDINT;
dwCurrentSearchSlaveId                : DWORD;
eResSlaveAddrET0AndSlaveIdLTSerachId  : E_SMICompResSlaveAddrET0AndSlaveIdLTSearchId;
eResSlaveAddrET0AndSlaveIdGTSerachId  : E_SMICompResSlaveAddrET0AndSlaveIdGTSearchId;
eResSlaveAddrET0AndSlaveIdETSerachId  : E_SMICompResSlaveAddrET0AndSlaveIdETSearchId;
eResSlaveAddrNE0                      : E_SMICompResSlaveAddrNE0;

bBusy: when the block is activated the output is set, and it remains active until execution of the command has been completed.

bError: this output is switched to TRUE as soon as an error occurs during the execution of a command. The command-specific error code is contained in udiErrorId. The output is again set to FALSE by the reactivation of the function block via the bStart input.

udiErrorId: contains the command-specific error code of the most recently executed command. It is set back to 0 by the reactivation of the function block via the bStart input. See Error codes.

dwCurrentSearchSlaveId: as soon as the execution of the function block has ended (bBusy changes from TRUE to FALSE) this output indicates the slave ID of the SMI device found.

eResSlaveAddrET0AndSlaveIdLTSerachId: at least one motor / no motor has the address 0 and the slave ID is smaller than the slave ID sought (dwSlave-Id) / the value is undefined.

eResSlaveAddrET0AndSlaveIdGTSerachId: at least one motor / no motor has the address 0 and the slave ID is larger than the slave ID sought (dwSlave-Id) / the value is undefined.

eResSlaveAddrET0AndSlaveIdETSerachId: at least one motor / no motor has the address 0 and the slave ID is also the same as the slave ID sought (dwSlave-Id) / the value is undefined.

eResSlaveAddrNE0: at least one motor / no motor has an address unequal 0 / the value is undefined.

VAR_IN_OUT

stCommandBuffer             : ST_SMICommandBuffer;

stCommandBuffer: reference to the structure for communication (buffer) with the FB_KL6831KL6841Communication() block.

Requirements

Development environment

Target system

Required libraries

TwinCAT 2.11 R3/x64 from build 2238

PC/CX, BX or BC

TcSMI library from V1.0.0