Comfort Automation/ Security System Forums
Best way to know the state of a flag - Printable Version

+- Comfort Automation/ Security System Forums (https://www.comfortforums.com)
+-- Forum: Products (https://www.comfortforums.com/forum-3.html)
+--- Forum: Questions on Using Comfort (https://www.comfortforums.com/forum-159.html)
+--- Thread: Best way to know the state of a flag (/thread-672.html)



- ruirego - 06-19-2007

What is the best way to know the state (if it\'s 1 or 0) of a flag?

Thaks

Rui

 



- Guest - 06-19-2007

Set it as the status in the control menu?

What do you aim to achieve?



- ruirego - 06-21-2007

Thank\'s!

It was just to test this response:

[indent]
If Flag Flag01 <> 0 Then
    Do _sim_presenca_02 [p0_luz cozinha_off]
    Do _sim_presenca_04 [p1_luz cozinha_off]
    Do _sim_presenca_06 [p1_quarto susana_off]
    Do _sim_presenca_08 [ex_varanda_off]
    Do _sim_presenca_10 [ex_jardim suite_off]
    Do _sim_presenca_12 [ex_muro circuito 1_off]
    Do _sim_presenca_14 [p1_quarto srª conceição_off]
    Clear Flag Flag01
End If
[/indent]
The flag is set when the system is armed in vacation mode.

Before this response all the lights in vacation mode remain on after the custemer disarm the system.

Rui



- Guest - 06-21-2007

Rui,

If you are using a flag to determine whether in vacation mode before deciding to execute responses or not, wouldn\'t it be easier to set it such that:

If  SecurityMode = VacationMode Then
    Do _sim_presenca_02 [p0_luz cozinha_off]
    Do _sim_presenca_04 [p1_luz cozinha_off]
    Do _sim_presenca_06 [p1_quarto susana_off]
    Do _sim_presenca_08 [ex_varanda_off]
    Do _sim_presenca_10 [ex_jardim suite_off]
    Do _sim_presenca_12 [ex_muro circuito 1_off]
    Do _sim_presenca_14 [p1_quarto srª conceição_off]
    Clear Flag Flag01
End If



- ruirego - 06-21-2007

Hi,

 

Here is the scenario:



 

On the vacation programs I have some responses (see attach).



This responses are just EIB light groups.



When the system is in vacation mode this light groups are turn ON and OFF randomly.

 

Until here everything OK.

 

The problem was - when the customer arrives home and disarm the system, all the lights that where ON remain ON

 



- slychiu - 06-26-2007

Your solution should work then
When you arm to vacation mode, you set the flag by the vacation Mode response
when you disarm you check the flag and control the lights if it is on. That is a good pieve of programming

Does this work?



- ruirego - 07-02-2007

Yes, it works fine.