FB_DALIV2xOsramProfSensorCoupler

![]() | This function block is used as an example and is not included in the library. The function block can be downloaded as an export file and imported into the desired project. Adjustments can be made as required. |
The function block FB_DALIV2xOsramProfSensorCoupler evaluates the measured brightness and the occupancy of the Osram DALI Professional Sensor Coupler. This function block can also be used to initialize the DALI control device.
The motion sensor and the light sensor have separate short addresses. The DALI control device thus occupies two short addresses. The device does not fully comply with the IEC 62386 standard and uses a company-specific protocol instead.
A detected movement is sent as an event while the brightness is read cyclically.
Download the TwinCAT 3 PLCopenXML file: FB_DALIV2xOsramProfSensorCoupler.zip
Inputs
VAR_INPUT
bInitialize : BOOL := FALSE;
(* Occupancy Sensor Parameters *)
nPIRAddr : BYTE;
tPIRBlankingTime : TIME := T#1M;
(* Light Sensor Parameters *)
nLSAddr : BYTE;
tLSCycleTime : TIME := T#1M;
END_VAR
Name | Type | Description |
---|---|---|
bInitialize | BOOL | The DALI control device is initialized via a positive edge at this input. The parameters are written to the DALI control device, which must be accessible via the short addresses nPIRAddr and nLSAddr. The output bInitializing is TRUE during initialization. |
nPIRAddr | BYTE | Short address of the DALI control device for the motion sensor |
tPIRBlankingTime | TIME | Parameter: Once the status of the motion sensor was sent, no further changes are sent for this time. The unit is 1 s. This means that times of up to 4 min 15 s (value 255) are possible. |
nLSAddr | BYTE | Short address of the DALI control device for the light sensor |
tLSCycleTime | TIME | Cycle time in which the current actual value of the light sensor is read. |
Further details about the parameters can be found in the manufacturer's documentation.
Inputs/outputs
VAR_IN_OUT
stCommandBuffer : ST_DALIV2CommandBuffer;
END_VAR
Name | Type | Description |
---|---|---|
stCommandBuffer | ST_DALIV2CommandBuffer | Reference to the internal structure for communication with FB_KL6821Communication (KL6821). |
Outputs
VAR_OUTPUT
bInitializing : BOOL;
bError : BOOL;
nErrorId : UDINT;
(* Occupancy Sensor *)
nPIRStatus : BYTE;
bPIROccupied : BOOL;
(* Light Level *)
nLSStatus : BYTE;
nActualLightLevel : WORD;
END_VAR
Name | Type | Description |
---|---|---|
bInitializing | BOOL | This output is TRUE during initialization. |
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 nErrorId. |
nErrorId | UDINT | Contains the command-specific error code of the most recently executed command (see error codes). |
nPIRStatus | BYTE | Before the initialization, the status of the DALI control device for the motion sensor is queried and output at this output. |
bPIROccupied | BOOL | This output indicates the actual value of the motion sensor. |
nLSStatus | BYTE | Before the initialization, the status of the DALI control device for the light sensor is queried and output at this output. |
nActualLightLevel | WORD | This output indicates the actual value of the light sensor. |
Requirements
Development Environment | PLC library to include |
---|---|
TwinCAT from v3.1.4022.4 | Tc2_DALI from v3.6.2.0 |