FB_BARSMIRollerBlind
This function block works like the FB_BARRollerBlind only with the difference that an SMI motor is controlled directly.
Required library is the TwinCAT 2 PLC Lib: TcSMI.
Download PLC export file: FB_BARSMIRollerBlind.zip
VAR_INPUT
eDataSecurityType: E_HVACDataSecurityType;
bEnable : BOOL;
stSunblind : ST_BARSunblind;
tPositionRead : TIME;
dwAddr : DWORD;
eAddrType : E_SMIAddrType;
dwAddrOption : DWORD;
dwMasterDevAddr : DWORD;
eDataSecurityType: if eDataSecurityType:= eDataSecurityType_Persistent, the persistent VAR_IN_OUT variables of the function block are stored in the flash of the computer if a value changes. For this to work, the function block FB_HVACPersistentDataHandling must be instanced once in the main program, which is called cyclically. Otherwise, the instanced FB is not internally released.
If eDataSecurityType:= eHVACDataSecurityType_Idle the persistently declared variables are not saved in a fail-safe manner.
Notice | |
A cyclically changing variable must never be linked with the IN_OUT variable of a function block, if eDataSecurityType:= eHVACDataSecurityType_Persistent. It would lead to early wear of the flash memory. |
bEnable: enable input for the function block. As long as this input is TRUE, the actuator function block accepts and executes commands as described above. A FALSE signal at this input causes the function block to remain in an idle state.
stSunblind: positioning telegram, see ST_BARSunblind.
tPositionRead: interval at which the current position is read from the SMI motor when positioning commands are processed.
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.
dwMasterDevAddr: address (0-15) of the SMI motor from which the current position is to be read if eAddrType != eSMIAddrTypeAddress.
VAR_OUTPUT
uiActPosition: UINT;
bBusy : BOOL;
bError : BOOL;
udiErrorId : UDINT;
uiActPosition: current position in percent.
bBusy: a positioning process is taking place.
bError: this output is switched to TRUE if the parameters entered are erroneous.
udiErrorId : contains the error code if the values entered should be erroneous. See error codes.
VAR_IN_OUT
stCommandBuffer : ST_SMICommandBuffer;
stCommandBuffer: reference to the structure for communication (buffer) with the FB_KL6831KL6841Communication() function block.