This example demonstrates how to configure a menu system when you have a display with no touch buttons or hard buttons and your user input comes from a CAN message. An example of this would be a vehicle application where the controls are mounted on the steering wheel.
In this example you can either control the menu through the touch buttons or from a CAN message.
Menu control is kept simple with a move left, move right, and enter button.
The CAN message is monitored for a change in state which triggers an activity program to run and evaluate what menu operation needs to occur. The enter button has additional functionality to detect when the operator presses and holds the button to fire an action continuously.
Script routines and index variables are used to keep track of what menu is currently displayed and what actions need to be assigned to the current button command.
The layout is scalable where you can continue adding functionality.
The graphical layout uses image widgets where you can replace the existing numbered images with icons representing the desired function.
Each menu level is contained in a separate container widget using visibility tied to a index variable to determine if it needs to be shown.
A CANcapture workspace is available to test menu functionality. In general a value of 0 is broadcast for each button command then you use a hot key to send a one shot message with a value of 1 to trigger the action. Remember, the activity program is fired by a change in the value of the button message.