You are here: Reference Topics for Hardware > Momentary and Latching Toggle Configuration

Momentary and Latching Toggle Configuration

All of the Logic inputs in the HAL system, including those in the HAL hosts, the DR4, and the DR5, allow you to configure each input port as a toggle and to specify them as either Momentary or Latching. What does this mean? When you have configured a Logic In port as a toggle, Halogen creates a corresponding toggle control in the Control palette of the Processing Workspace. You can then link this toggle control to one or more other toggle controls, which allows an external physical switch, relay, or another similar device to control the state of the toggle. For example, if you link a Logic In toggle control to the mute toggle control of an audio output processing block, and then attach a physical two-position switch to the Logic In port, the end user can mute or unmute the audio of the output block by changing the switch position.

What is Momentary and how do I use it?

One way to configure a Logic In port is to set it to Momentary. You use this setting if you intend to connect a momentary contact type of physical switch to the Logic In port, which could be a push button, for example. With a normally open momentary push button switch, the switch contacts are open when no one is pushing on the button and closed when someone pushes the button. Systems typically use these types of switches when the end user wishes to turn something on (for example open a wall) by pushing and releasing the button and then turning the same thing off (close the wall) by pushing the button again.

This is exactly what the HAL system does when you have configured a Logic In port to be a Toggle and set it to Momentary. In this case pressing the button the first time sets the state of the corresponding toggle control in the Processing Workspace to ‘checked’ and pressing it again sets the toggle control to ‘unchecked’. The following shows how this works in more detail using a DR5 input port, a momentary switch, and a Room Combine block wall toggle.

First, the following diagram shows how to connect two normally open, momentary push button switches to DR5 Switch input ports. You should configure these ports as Momentary in the Hardware Workspace property dialog for the DR5.

Once you have configured the DR5 in the Hardware Workspace, Toggle controls appear in the HW Control palette of the Processing workspace. You can then link each control to any other Toggle control in your system. The following diagram shows the Control palette and a corresponding Toggle control for the DR5 and how to link it to a wall toggle control in a Room Combine block. It also shows a portion of the DR5 property dialog from the Hardware Workspace showing Toggle (9) configured as a Momentary Toggle.

What is Latching and how do I use it?

The other way to configure a Logic In port is Latching. You use this setting when you wish to connect a two state device to the Logic In port, where the device remains in one state or the other for the duration of the condition you are signaling to HAL. For example, suppose you have a two position switch that you wish to connect to a Logic In port in order to allow an end user to mute the audio of an audio output block when the switch is in one position and to unmute it when the switch is in the other position.

This is what the HAL system does when you configure a Logic In port to be a Toggle and set it to Latching. Setting a physical switch connected to the Logic In port to one position sets the corresponding Toggle control in the Control palette of the Processing Workspace to ‘checked’, while setting the physical switch to the other position sets the Toggle control to ‘unchecked’. The diagram below shows this in more detail using a DR4 Logic In port, a two position physical switch and a HAL Line Output I/O block Mute Toggle control.

The following diagram shows how to connect a two position switch to the DR4 Switch input port. You should configure this type of port as Latching in the Hardware Workspace property dialog for the DR4.

Once you have configured the DR4 in the Hardware Workspace, a Toggle control appears in the Control palette of the Processing workspace. You can then link this control to any other Toggle control in your system. The following diagram shows the Control palette and the corresponding Toggle control for the DR4 and how to link it to a Mute toggle control in a HAL1 Line Output block. It also shows a portion the DR4 property dialog from the Hardware Workspace, with Toggle (29) configured as a Latching Toggle.

What are other differences between Momentary and Latching settings for a Logic In toggle?

Momentary and Latching are also different in the following ways:

  • When a port is set to Latching, the corresponding toggle control is read-only. This means that when the toggle control is a participant in a link, it is the only control that sets the value for all participants in the link. Also, there can be only one read-only participant in a link.
  • When a port is set to Momentary, the corresponding control is not read-only. When it participates in a link, any of the participants can set the value of the link (unless of course one of the participants is a read-only control). This means that you could have two or more momentary physical switches control the state of a toggle link, such as a room combine block’s wall toggle control. Or, you can link an external control system’s toggle control to a Logic In toggle control, allowing both a physical momentary switch and an external control system such as an AMX controller to change the value of the link.
What kind of device can I connect to a Logic In port?

You can use physical momentary or multiple position switches, relay contacts, or active logic circuits. The Logic In port for each HAL system device has a pull-up resistor which keeps the port signal at a logic high (5 V) when nothing is connected. To change the state of the Logic In, a device connected to the input port must pull the port signal down lower than the threshold for logic low, which is specified in the data sheet for the device (HAL, DR4, DR5, for example). Typically you do this by connecting the port signal pin (labeled with a number near the physical connector) to one of the ground reference pins (labeled with the letter G).