FB_DALIV2EmergencyLightingDT
The function block FB_DALIV2EmergencyLightingDT is used for the duration test of a DALI emergency lighting device. At the end of the test, the test results are written to a FIFO buffer (IN-OUT variable fbStringRingBuffer), which in turn is read into a file by the function block FB_DALIV2FileLogging. Events that hinder or interrupt the test are displayed in addition to the result message at the bError and nErrorID outputs.
The following events prevent the execution of a duration test:
- The device operates in automatic duration test mode, i.e. a test interval is programmed in the device.
- The device is currently executing a test or a test is automatically pending (function test or duration test).
- The emergency battery is not completely charged.
- The device is not in emergency standby ("normal mode") at the start of the test.
Events that interrupt an active duration test include the following:
- The device has not reached the duration test mode after the test has started.
- The test was not completed correctly, after the test start and a certain delay time the device is eventually neither in test mode nor (back) in emergency standby mode ("normal mode").
- A DALI command was incorrectly processed.
- The timeout has expired.
Inputs
VAR_INPUT
bStart : BOOL;
bStop : BOOL;
nAddr : BYTE;
sController : STRING(20);
sLineName : STRING(10);
sDescription : STRING(20);
sLocation : STRING(20);
stDateTime : TIMESTRUCT;
tTimeout : TIME := t#120m;
END_VAR
Name | Type | Description |
---|---|---|
bStart | BOOL | The function block is activated by a positive edge at this input. |
bStop | BOOL | If a duration test has been successfully started, the emergency mode and the emergency status are internally cyclically queried in order to assess when the test is completed and whether errors have occurred during the test. A positive edge at the input bStop aborts the duration test in precisely this phase and records a corresponding message in the log file. This is useful if it is only necessary to assess whether the emergency lighting runs for a certain time (until the time of stopping). |
nAddr | BYTE | Address of the device to be tested |
sController | STRING | Controller to which the DALI device belongs. Serves the description in the log file. |
sLineName | STRING | Line to which the DALI device belongs. Serves the description in the log file. |
sDescription | STRING | Further supplementary description of the device in the log file |
sLocation | STRING | Description of the installation location |
stDateTime | TIMESTRUCT | Input for current date and time |
tTimeout | TIME | Time within which the test must be completed. |
Inputs/outputs
VAR_IN_OUT
stCommandBuffer : ST_DALIV2CommandBuffer;
fbStringRingBuffer : FB_MemRingBuffer;
END_VAR
Name | Type | Description |
---|---|---|
stCommandBuffer | ST_DALIV2CommandBuffer | Reference to the internal structure for communication with FB_KL6811Communication (KL6811) or FB_KL6821Communication (KL6821). |
fbStringRingBuffer | FB_MemRingBuffer | Reference to the FIFO buffer in which the log entries are stored. |
![]() | It is not possible for the log function block to write data to a file as long as that file is open. |
Outputs
VAR_INPUT
tElapsedTestTime : TIME;
nEmergencyMode : BYTE;
nEmergencyStatus : BYTE;
bBusy : BOOL;
bError : BOOL;
nErrorId : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
tElapsedTestTime | TIME | Test duration. The time output is set to 0 by a rising edge at bStart and then counts up as long as the function block is active. With a falling edge at bBusy, the output retains its current value so that the test duration is still available even after the function block has been processed. |
nEmergencyMode | BYTE | During the test, the presently internally queried emergency mode of the DALI device is output at this output. |
nEmergencyStatus | BYTE | the same applies to emergency status |
bBusy | BOOL | When the function block is activated the output is set, and it remains active until execution of the command has been completed. |
bError | BOOL | This output is switched to TRUE if an error, as described above, occurs during the execution of the test. This output is reset on restarting a test. |
nErrorId | UDINT | Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of a command at the inputs (see error codes). |
Requirements
Development Environment | PLC library to include |
---|---|
TwinCAT from v3.1.4020.14 | Tc2_DALI from v3.4.3.0 |