Makers Blog Archive

VDI 3813 Stairwell FB with PLCnext Engineer

aukq27uyy2lslpkdp734 23 December 2019 min. read
127 views 0 comments

The following Makers Blog consists of the Stairwell Light functionality as stated in the VDI 3813 directive

(BUILDING AUTOMATION AND CONTROL SYSTEMS (BACS) – FUNDAMENTALS OF ROOM CONTROL).

This directive consists of descriptions, ways to do room automation in order to increase the energy efficiency of a building.

Stairwell Light FB

Functionality of this block is as the title already gives a hint, to regulate lights in stairwells of your building. 

Depending on an input trigger to turn the lights on, these will be ON at your wanted Dimming Value.

After x amount of time when no longer in need of light, the lights will switch OFF.

With this additional feature that you can send a 1-time blinking of the lights, to warn the people that in x amount of seconds/minutes the lights in the stairwell will be switched off. 

This gives the user an indication to push the nearest light switch again so the light doesn’t turn off , while they are still present in the stairwell.

PLCnext Engineer Function Block:

1

INPUTS explained:

xStart:

This will start the Function Block and Send the rDim Value to the Output

rDim:

The wanted dimming value for the Stairwell (0-100%)

tHold:

Holding Time before definitely turning OFF the light ( if xStart does not get re-triggered )

tWarning:

Warning Time, is the amount of seconds/minutes before he definitely turning OFF of the lights when you want the light to blink 1 time to warn the people in the stairwell that soon the lights will turn OFF if no re-trigger is performed.

OUTPUTS explained:

rDimOutValue: This is the dimming value sended to the Lights in the stairwell

PLCnext Engineering Structure Text Code of the FB_Stairwell-Vdi3813:

// Function Block for Stairwell lighting following the VDI 3813 Directives for building Automation

// Trigger Start
R_TRIG_Start(CLK := xstart);

// Initiate FB after Start Trigger

IF R_TRIG_Start.Q THEN

iCnt := Int#0 ;
xStartWarningTimer := FALSE ;
xStartHoldingTimer := FALSE ;
xBlinkedDone := FALSE ;
xWait := TRUE ;

END_IF;

// Additional waiting step

IF TON_Wait.Q THEN
iStairwell := INT#1;
END_IF;

CASE iStairwell OF

0: // Initiate values
iCnt := Int#0 ;
rDimOutValue := REAL#0.0 ;
xStartWarningTimer := FALSE ;
xStartHoldingTimer := FALSE ;
xBlinkedDone := FALSE ;

1: // wait for Activation trigger to write the dim value to the output and start the Holding Timer
xWait := FALSE ;
xStartWarningTimer := TRUE ;
xStartHoldingTimer := TRUE ;
iStairwell := Int#2 ;

2: // Holding Timer is started and waiting for the Warning Timer to turn active and give a 1 time blink at the output
IF NOT TON_HoldingTimer.Q THEN

rDimOutValue := rDimValueChosen ;

IF TON_WarningTimer.Q AND NOT xBlinkedDone THEN

iStairwell := Int#3;

END_IF;

ELSE iStairwell := Int#0 ;
END_IF;

3: // Blink Output once and return to Holding Timer

rDimOutValue := REAL#0.0 ;
iCnt := iCnt + Int#1 ;

IF iCnt >= Int#10 THEN

xBlinkedDone := TRUE ;
iStairwell := Int#2 ;

END_IF;

END_CASE;

(************************** Instances **************************)

// Timers

// Determination if inputs tHoldingTime & tWarningTime are valid

IF (tHoldingTime > tWarningTime) AND (tHoldingTime > T#6s) THEN
xInitValueValidTimers := TRUE ;
ELSE xInitValueValidTimers := FALSE;
END_IF;

IF xInitValueValidTimers THEN

tHoldingTimerTime := tHoldingTime ;
tWarningTimerTime := SUB_TIME( tHoldingTime , tWarningTime );

ELSIF NOT xInitValueValidTimers AND (tHoldingTimerTime >= T#5s) THEN

tHoldingTimerTime := tHoldingTime ;
tWarningTimerTime := SUB_TIME( tHoldingTime , T#5s );

END_IF;

// Determination if input Dim level is a valid value between 0-100%

IF rDimSetValue > Real#100.0 THEN
rDimValueChosen := Real#100.0 ;

ELSIF rDimSetValue < Real#0.0 THEN

rDimValueChosen := Real#0.0 ;

ElSE rDimValueChosen := rDimSetValue ;
END_IF;
// Warning Time= Moment when the output should blink 1 time to indicate turning off Output Value
TON_WarningTimer(IN := xStartWarningTimer, PT := tWarningTimerTime, ET => tElapseWarning );

// Holding Time = Duration until the timer should stop, switch off Output
TON_HoldingTimer(IN := xStartHoldingTimer, PT := tHoldingTimerTime , ET => tElapseHolding);

// Wait Timer
TON_Wait(IN := xWait, PT := T#1s );

If you would like to have this FB, feel free to contact me at gwilde@phoenixcontact.be 

Note:

The Makers Blog shows applications and user stories of community members that are not tested or reviewed by Phoenix Contact. Use them at your own risk.

Discussion

Please login/register to comment

Login/Register

Leave a Reply

Newsletter
Never miss a new article
Sign up for the newsletter
Never miss news about PLCnext Technology
Get interesting content via newsletter four times a year
Receive exclusive information before all other users