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 for addressing SMI devices and is used in the function block FB_SMIAddressing().

FB_SMIDiscoverySlaveId 2: Inputs

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

Name

Type

Description

bStart

BOOL

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

bCancel

BOOL

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

byManufacturer

BYTE

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

dwOptions

DWORD

Reserved for future extensions

FB_SMIDiscoverySlaveId 3: Inputs/outputs

VAR_IN_OUT
  stCommandBuffer : ST_SMICommandBuffer;
END_VAR

Name

Type

Description

stCommandBuffer

ST_SMICommandBuffer

Reference to the structure for communication (buffer) with the function block FB_KL6831KL6841Communication()

FB_SMIDiscoverySlaveId 4: Outputs

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

Name

Type

Description

bBusy

BOOL

This output is set as soon as the function block processes a command and remains active until the command has been processed.

bError

BOOL

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 reset to FALSE by the reactivation of the function block via the input bStart.

udiErrorId

UDINT

Contains the command-specific error code of the most recently executed command. It is reset to 0 by the reactivation of the function block via the input bStart (see error codes).

dwCurrentSearchSlaveId

DWORD

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

E_SMICompResSlaveAddrET0AndSlaveIdLTSearchId

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

E_SMICompResSlaveAddrET0AndSlaveIdGTSearchId

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

E_SMICompResSlaveAddrET0AndSlaveIdETSearchId

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

E_SMICompResSlaveAddrNE0

At least one motor / no motor has an address unequal 0 / the value is undefined.

Requirements

Development Environment

PLC library to include

TwinCAT from v3.1.4020.14

Tc2_SMI from 3.3.5.0