FB_DALIV2EmergencyLightingDT

FB_DALIV2EmergencyLightingDT 1:

This function block is for the duration 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 duration test:

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

FB_DALIV2EmergencyLightingDT 2:

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

FB_DALIV2EmergencyLightingDT 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;
bStop         : 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.

bStop: When a Duration-test was successfully started, the Emergency-Mode and Emergency-Status will be periodically polled to see, if the test is finished and if any errors occurred. A rising edge at the bStop-Input will terminate the test at this stage, giving a special message in the log-file. This feature is neccessary, when it has only to be proven, that the emergency-device is running for a specific time - until the stop-signal is given.

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 must 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 Duration-Test for the three emergency-devices will be executed on the 8th of every month.

The log-file will look like this:

FB_DALIV2EmergencyLightingDT 4:

In July the emergency-devices are not installed, yet. The tests result in DALI-command-errors on all devices.

In August the first device is installed, but the battery was not completely charged.

Finally, in September all devices are installed and fully functional. The tests were succesful.

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