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

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?

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...