FB_SMIParValueReadWord
The function block FB_SMIParValueReadWord reads a word parameter (2 bytes) stored on the motor side. The meaning of the individual parameters is manufacturer-specific.
Inputs
VAR_INPUT
bStart : BOOL;
dwAddr : DWORD := 0;
eAddrType : E_SMIAddrType := eSMIAddrTypeAddress;
dwAddrOption : DWORD := 0;
eCommandPriority : E_SMICommandPriority := eSMICommandPriorityMiddle;
wParAddr : WORD := 0;
END_VAR
Name | Type | Description |
---|---|---|
bStart | BOOL | The function block is activated and the command is sent by applying a positive edge to this input. |
dwAddr | DWORD | Manufacturer code (0-15), address of a device (0-15), bit field (16 bits) for group addressing or slave ID (32-bit key ID). This input has no meaning if a broadcast is sent. |
eAddrType | Specifies whether the input dwAddr is to be evaluated as manufacturer code, address of a device or for group addressing. Addressing via slave ID (eAddrType = eSMIAddrTypeSlaveId) is not permitted. | |
dwAddrOption | DWORD | Reserved for future extensions |
eCommandPriority | Priority (high, medium or low) with which the command is processed by the PLC library. | |
wParAddr | WORD | Address of the parameter (0-4095) to be read. |
Inputs/outputs
VAR_IN_OUT
stCommandBuffer : ST_SMICommandBuffer;
END_VAR
Name | Type | Description |
---|---|---|
stCommandBuffer | Reference to the structure for communication (buffer) with the function block FB_KL6831KL6841Communication() |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
udiErrorId : UDINT;
wParValue : WORD;
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). |
wParValue | WORD | The read Word parameter |
Requirements
Development Environment | PLC library to include |
---|---|
TwinCAT from v3.1.4020.14 | Tc2_SMI from 3.3.5.0 |