Conditional Relay Control with N-Button

N-Button software allows you to create buttons and widgets to control NCD relay boards.  You can simply turn relays on or off with control buttons , or configure conditional rules to control relays.

Here we will show you an example to set up conditional rules to control relays.

We will use the push button of Push Notification board to control a relay board. Both of the Push Notification and relay board are from National Control Devices.

Example Tasks:

  • When Button 1 is pressed, Relay 1 will turn on for 5 seconds
  • When Button 2 is pressed, Relay 2 will turn on for 5 seconds
  • When Relay 1 is on, Relay 2 cannot be on
  • When Relay 2 is on, Relay 1 cannot be on

This example of conditional logic might occur when you use a relay board to control two different doors or valves.  Simple logic will prevent them from opening at the same time.

Step 1: Be sure you already have N-Button software installed on your computer.  Both Push Notification board and Relay Board should be connected to your computer.

Relay Board and Push Notification Board

 

Step 2: Run N-Button Lite or Pro, add Push Notification board and Relay Board to Device Manager.

N-Button software - Add Devices

 

Step 3: Add two Relay Button widgets to toggle Relay 1 and Relay 2 separately.

N-Button software - Add Relay Button

 

You will see the Relay Button widgets on your desktop. Click the button to turn on/off Relay 1 and Relay 2 separately. Green means the relay is ON. Red means the relay is OFF.

N-Button software -Relay Button Widget

 

Step 4: Add two Scan Channel widgets to indicate the status of Push Button 1 and Push Button 2.

N-Button software -Add Scan Channel Widget

 

You will see the Scan Channel widgets on your desktop. Both will be red. When you press one of the Push Buttons down, it will turn green.

N-Button software - Scan Channel Widget

 

Step 5:  Add two simple Conditions for Relay 1 and Relay 2 separately. The initial status of conditions are Meet. The condition works as a mark for relay channel. The relay will be controlled as long as the condition is Meet.

N-Button software - Add Conditions

 

Step 6: Add two Actions List for both Push Buttons. Once the Push Button is pressed, the Actions on the list will be executed one by one.

N-Button software - Add Actions List

 

For Push Button 1, when the button is pressed, 5 actions will be executed.

  • Lock Relay 2 : Condition Action to set the Condition 2 (Mark for Relay 2) as Not Meet.
  • Turn Relay 1 On: Relay Action to turn Relay 1 On.
  • Wait: Wait Action for 5 seconds. Relay 1 will stay On for 5 seconds.
  • Turn Relay 1 Off: Relay Action to turn Relay 1 Off.
  • Unlock Relay 2 : It is a Condition Action to set the Condition 2 (Mark for Relay 2) as Meet.

Similarly, the 5 actions for Push Button 2 are shown as below.

N-Button software - Actions List

 

  • Lock Relay 1 : Condition Action to set the Condition 1 (Mark for Relay 1) as Not Meet.
  • Turn Relay 2 On: Relay Action to turn Relay 2 On.
  • Wait: Wait Action for 5 seconds. Relay 2 stay On for 5 seconds.
  • Turn Relay 2 Off: Relay Action to turn Relay 2 Off.
  • Unlock Relay 1 : Condition Action to set the Condition 1 (Mark for Relay 1) as Meet.

All settings are now complete. You will see 4 widgets on your desktop.

 

When you press Push Button 1, you will see the Relay Button 1 and Scan Channel 1 turn green. Try to press Button 2 during the 5 seconds after you press Button 1, there is no action for Relay 2.

 

After 5 seconds, Relay 1 is Off. Press Button 2, you will see the Relay Button 2 and Scan Channel 2 turn green. Try to press Button 1 during the 5 seconds after you press the Button 2, there is no action for Relay 1 also.

 

The video shows how it works.

Here we just set the Relay 1 and Relay 2 to stay On for 5 seconds, you can set the time as needed.  With the condition rule, you have more ways to control relays with N-Button software.