Jump to content

Program Logic Assist Pls


Recommended Posts

Posted

Am I writing this correctly? My intention is to trigger THEN if either of the /Main House/Sensors are tripped AND the $Gates_ProgON is 0. I wasn't sure if I needed the parenthesis around the separate pairs of conditions with an OR in between or not.

North Gate OPEN - [ID 0019][Parent 0031]

If
     'Main House / Sensors / North Gate' is switched On
    And $Gates_ProgON is 0
     Or 'Main House / Sensors / ZY 033 North_Gate' Access Control is Window/door is open
    And $Gates_ProgON is 0
 
Then
        $North_Gate_Open  = 1
        Run Program '_North Gate' (If)
 
Else
   - No Actions - (To add one, press 'Action')
 

Posted

I would likely write it like this just for clarity

 

North Gate OPEN - [ID 0019][Parent 0031]

If
     (
    'Main House / Sensors / North Gate' is switched On
         Or 'Main House / Sensors / ZY 033 North_Gate' Access Control is Window/door is open

      )
    And $Gates_ProgON is 0
 
Then
        $North_Gate_Open  = 1
        Run Program '_North Gate' (If)
 
Else
   - No Actions - (To add one, press 'Action')

Posted
7 minutes ago, lgilsenberg said:

 

I would likely write it like this just for clarity

 

North Gate OPEN - [ID 0019][Parent 0031]

If
     (
    'Main House / Sensors / North Gate' is switched On
         Or 'Main House / Sensors / ZY 033 North_Gate' Access Control is Window/door is open

      )
    And $Gates_ProgON is 0
 
Then
        $North_Gate_Open  = 1
        Run Program '_North Gate' (If)
 
Else
   - No Actions - (To add one, press 'Action')

That's the better, more predictable way of doing it.

Posted

Not that it matters here since you have no Else statements, but be aware that this program will also run every time the Gates_ProgON variable is changed.

Posted

Thanks for the insight.

Right now, Gates_ProgON can be fired with a second gate. That program has a different Then action.

Should I create individual variables for each program, or is there a way to write the statements in each program so they do not fire each other off. (The second gate program is identical, using different sensors.)

Also, can I import the updated text into EISY, or do I have to recreate it using the UI?

 

Guest
This topic is now closed to further replies.

×
×
  • Create New...