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.
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.
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.
Momentary and Latching are also different in the following ways:
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).