Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best way to know the state of a flag
#1
What is the best way to know the state (if it\'s 1 or 0) of a flag?

Thaks

Rui

 
Reply

#2
Set it as the status in the control menu?

What do you aim to achieve?
Reply

#3
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
Reply

#4
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
Reply

#5
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

 


Attached Files Thumbnail(s)
   
Reply

#6
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?
Reply

#7
Yes, it works fine.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2026 Melroy van den Berg.