FB_SMIPosRead
The current position is read from the drive.
VAR_INPUT
bStart : BOOL;
dwAddr : DWORD := 0;
eAddrType : E_SMIAddrType := eSMIAddrTypeAddress;
dwAddrOption : DWORD := 0;
eCommandPriority : E_SMICommandPriority := eSMICommandPriorityMiddle;
bStart: The function block is activated and the command is send by 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: Determines whether the input dwAddr is evaluated as manufacturer code, device address (see E_SMIAddrType) or as part of the group address. Addressing via slave ID (eAddrType = eSMIAddrTypeSlaveId) is not permitted.
dwAddrOption: Reserved for future extensions.
eCommandPriority: Priority (high, medium or low) with which the command is processed by the PLC library (see E_SMICommandPriority).
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
udiErrorId : UDINT;
wPosition : WORD;
bBusy: When the function 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 set back 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).
wPosition: The position read out. The value 0 corresponds here to the upper final position and the value 65535 (0xFFFF) to the lower final position.
VAR_IN_OUT
stCommandBuffer : ST_SMICommandBuffer;
stCommandBuffer: reference to the structure for communication (buffer) with the FB_KL6831KL6841Communication() function block (see ST_SMICommandBuffer).
Prerequisites
Development environment | required TC3 PLC library |
---|---|
TwinCAT from v3.1.4020.14 | Tc2_SMI from 3.3.5.0 |