FB_SMIPos1Write

FB_SMIPos1Write 1:

Writes the fixed position Pos1 which is configurable on the motor side. Pos1 can be changed using the FB_SMIPos1Read() block.

VAR_INPUT

bStart            : BOOL;
dwAddr            : DWORD := 0;
eAddrType         : E_SMIAddrType := eSMIAddrTypeAddress;
dwAddrOption      : DWORD := 0;
eCommandPriority  : E_SMICommandPriority := eSMICommandPriorityMiddle;
wPosition         : WORD := 0;

bStart: the function block is started and the command is sent on applying a positive edge to this input.

dwAddr: manufacturer code (0-15), address of a device (0-15), bit field (16 bits) for the group addressing or slave ID (32-bit key ID). This input has no meaning if a collective call (broadcast) is sent.

eAddrType: defines whether the dwAddr input is to be evaluated as a manufacturer code, the address of a device, for group addressing or as a slave ID.

dwAddrOption: if the SMI device is addressed by slave ID (eAddrType = eSMIAddrTypeSlaveId), then the manufacturer code must be specified via this input.

eCommandPriority: priority (high, medium or low) with which the command is processed by the PLC library.

wPosition: the new fixed position Pos1. The value 0 corresponds here to the upper final position and the value 65535 (0xFFFF) to the lower final position.

VAR_OUTPUT

bBusy         : BOOL;
bError        : BOOL;
udiErrorId    : UDINT;

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.

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