FB_DALIV2EmergencyLightingFT

FB_DALIV2EmergencyLightingFT 1:

This function block is for the function test of a DALI emergency lighting device. At the end of the test the results are written over a FIFO buffer (IN-OUT variable fbStringRingBuffer), which in turn is read by the function block FB_DALIV2FileLogging() into a file. 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 function test:

The events that interrupt a function test that has begun include:

FB_DALIV2EmergencyLightingFT 2:

This function block is available only in the PC version of the DALIV2 library.

FB_DALIV2EmergencyLightingFT 3:

It is not possible for the log function block to write data to a file as long as that file is open!

VAR_INPUT

bStart           : BOOL;
nAddr            : BYTE;
sController      : STRING(20);
sLineName        : STRING(10);
sDescription     : STRING(20);
sLocation        : STRING(20);
stDateTime       : TIMESTRUCT;
tTimeout         : TIME := t#120m;

bStart: A rising edge activates the function-block.

nAddr: Address of the device.

sController: Name of the controller, as a description for the log-file.

sLineName: Name of the line.

sDescription: Further description of the device for the log-file.

sLocation: Location, where the lamp is installed.

stDateTime: Actual date and time.

tTimeout: The test has to be successfully executed in this time.

VAR_OUTPUT

tElapsedTestTime  : TIME;
nEmergencyMode    : BYTE;
nEmergencyStatus  : BYTE;
bBusy             : BOOL;
bError            : BOOL;
nErrorId          : UDINT;

tElapsedTestTime: Test-duration. With a rising edge at bStart this value is first set to 0. As long as the function-block is active, it shows the elapsed test-time. With a falling edge at bBusy the output remains at its value, so the time, used for the test, is still available.

nEmergencyMode: During the test this output shows the internally queried value of the Emergency-Mode.

nEmergencyStatus: do. Emergency-Status.

bBusy: If the function-block is active, this output is set to TRUE.

bError: This output is switched to TRUE if an error occurs as described above. Is reset by the execution of a new test.

nErrorId: Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of a new test. See Error codes.

VAR_IN_OUT

stCommandBuffer      : ST_DALIV2CommandBuffer;
fbStringRingBuffer   : FB_MemRingBuffer;

stCommandBuffer: A reference to the structure for communication with the FB_DALIV2Communication() (KL6811) or FB_KL6821Communication() (KL6821) block.

fbStringRingBuffer: Reference to the FIFO-Buffer, in which the log-entries are put.

A sample-program shows the correct assignment of the inputs as well as the link to the logger-FB FB_DALIV2FileLogging(). In this program the Function-Test for the three emergency-devices will be executed every Tuesday.

The log-file will look like this:

FB_DALIV2EmergencyLightingFT 4:

On 25th August the emergency-devices are not installed, yet. The tests result in DALI-command-errors on all devices.

On 1st September the first device is installed but has still the internal automatic-test activated.
Finally, on 8th September all devices are installed and fully functional. The tests shows good results.

When this file is opened, it may be necessary to adjust the width of the columns, so all the data is visible.