Open topic with navigation
This section explains how to integrate a HAL command control with buttons on an XPanel by examining a single application: a touch panel button that asserts a HAL preset. We start by breaking down the logic symbols and signal flow for the HAL command control. Then we examine how to bind the HAL command control to a button in the touch panel user interface.
Command controls are stateless in a HAL system. Unlike toggles, they have no on or off values. HAL Command controls are merely triggers for predefined actions like command presets. Think of them as "Fire and forget." Because they are stateless, the feedback for a command button on a touch panel must be momentary. The example program has symbols to deal with command button presses from a touch panel. Let’s take a look at them.
Open the Rane_HAL.smw program file in SIMPL Windows. Double-click the XPanel symbol under the Ethernet slot of the controller and the Serial I/O symbol under Logic in the Program View to bring up their details.
There is one HAL command control in this program uniquely identified by HAL control number 3. This control number appears in the Command tab of Halogen’s External Control Systems dialog as Default Command Control.
Whenever the Default Level button on the XPanel is clicked the Serial I/O sends a message string to Halogen/HAL. These ‘command’ messages contain a command control type and a HAL control number. The only valid ‘command’ message for the HAL command control in this example is
note: Refer to Appendix A External Control Message Protocol for more information on command messages.
When a client sends a ‘command’ message, Halogen/HAL echoes it back to all its other clients. The Serial I/O in this program currently ignores unsolicited
<C&3> ‘command’ messages but you can add a string parameter to parse them if you want your touch panel to exhibit feedback when they arrive.
The momentary nature of a HAL command control makes generating feedback for a button on a touch panel very simple. Just route the touch panel button’s press output signal to the feedback input signal. That’s all there is to it. The button on the XPanel will only appear active when you hold it down.
This example demonstrates how to get a button on a touch panel to trigger a command preset on a HAL. The example Halogen configuration contains a command preset that sets the levels of all the HAL line outputs to a default level of -40.0 dB. A preset like this is handy when a user wants to revert undesired audio settings back to their original defaults. The preset is linked to a Control Systems command control named Default Command Control. Invoking the HAL command control asserts the preset.
Open the ControlSystemSample.hal example configuration file in Halogen. Then open the External Control Systems dialog and select the Command tab. Clicking on the Default Level button in this dialog fires the HAL command control.
Open the Rane_HAL_TP.vtp project file in Vision Tools Pro-e. Next open the Sound page window to view the example touch panel design. Select the Default Level button in the Sound page window. Notice that the Digital Press Join number for this button is set to 4 to match the fb4 input and press4 output on the XPanel symbol in the program. The touch panel button will appear raised when it is in its inactive state and depressed when it is in its active state.
Launch the XPanel and verify that the Connected status indicator shows that you are connected. Refer to the Troubleshooting section if the status indicator says Disconnected. Drag the Lounge slider on the XPanel up to about 90%. Now press the Default Level button on the XPanel. The slider jumps to 50%. Also notice this command button doesn’t stick like the previous toggle buttons. Now adjust the Lounge slider down to 10% and assert the Default Level Preset from Halogen. The slider on the XPanel jumps back to the center again.
note: Refer to Appendix B Using PuTTY to Test External Control Systems for help with debugging if the system does not behave as described here.
Open topic with navigation