Creating Touch Screen Controls and Displays for VEX V5 Robot Brain
You can use Display or Push Button Simulink® Dashboard blocks in a Simulink panel and create a custom user interface on VEX® V5 Robot Brain. A panel floats above the model canvas and follows you throughout a model hierarchy.
The Display and Push Button Simulink Dashboard blocks can be connected to appropriate signal values or constants, and the model can be then deployed VEX V5 Robot Brain. After deployment, the Push Button and Display blocks are visible on the LCD touch-screen and you can perform the necessary actions.
To enable viewing the Display and Push Button blocks in the VEX V5 Robot Brain display, the blocks have to be promoted to a panel. Perform these steps to create a panel and to promote the blocks to the panel:
In the Simulink model, add Display Block or Push Button block as required.
On the Simulation tab, click Library Browser.
Select Simulink > Dashboard and then add a Display or Push Button block to the model.
To promote the selected blocks to a panel, move the cursor over the ellipsis (...) that appears at the end of the selection and select Promote to Panel from the menu that appears.
Provide a name for the panel by navigating to Modeling > Property Inspector.
Display Custom Message
If you want to display custom message on the screen, then you can use String Constant block. To display custom text messages, use String Constant block as shown in the image below.
The custom message added is displayed in the VEX V5 Robot Brain display as shown in the image below.
Connect Blocks to Signals or Tunable Parameters
After promoting the blocks to a panel, connect them to appropriate signals or tunable parameters. Perform these steps to connect the blocks to signals or tunable parameters:
Double-click the required Display and Push Button blocks to open the Block Parameters dialog box.
Connect blocks to signals or tunable parameters.
Display block: Click on the required signal in the Simulink Editor to connect the block to the signal. For more information on using Display blocks, see Display.
Push Button block: Click on the block that you want to connect to the Push Button block. All the tunable signals in the selected block are listed. Select the signal that you want to connect to the block.
When you press the Push Button block during a simulation, the value of the connected block parameter changes to the specified value. For more information on using Push Button block, see Push Button.
Select the required signal and then click Apply.
Control Visibility of a Panel
You can use the Manage Panels dialog to control panel visibility in the model. You can show or hide panels in your model using Manage Panels option.
To access all panels available in a model or change the visibility of a panel, select Manage Panels from the perspectives controls. You can access the perspectives controls by clicking the lower right corner of the Simulink Editor.
The Manage Panels dialog box is available only when your model includes panels.
The Manage Panels dialog hovers over the canvas and displays an icon for each panel in the model. Because this model contains three panels, you see three icons. You can use the Manage Panels dialog box to hide or show individual panels in your model, depending on the relevance of each panel to your present workflow. Click an icon to toggle the visibility for the corresponding panel. When panels are hidden, the icon becomes more transparent in the dialog box and the panel is not visible in the model.
To Show/Hide panels in your model
Click on the lower right corner of the Simulink Editor to access the perspectives controls.
Select Manage panels from the perspective controls.
Click Show/Hide All Panels to show or hide panels. Click the Fit Visible Panels to View button to gather all the visible panels in your model into the visible canvas.
If the Simulink panel is not rendered correctly while using Windows® 10 system, then perform these steps in the Windows 10 system:
Select Start > Settings > System > Display.
In the Scale and layout option, set Change the size of text, apps, and other items to 100%.
Click Advanced scaling settings.
Set Let Windows try to fix apps so they're not blurry option to off.
Perform these steps to edit a panel:
Move the cursor over the ellipsis (...) that appears at the end of the selection and select Edit Panel from the menu that appears.
Perform the required action:
: Change background image of the panel
: Send the panel to the back
: Send the panel to the front
: Delete the panel
Click Done Editing icon to complete editing the panel.
Minimize and Restore Panel
If you need to inspect or edit your model, you can minimize one or more panels by double-clicking each panel. Minimized panels remain visible in the model represented by icons. You can move the icon to a convenient place in your model while you edit or inspect the model contents. When you need to use the panel, you can restore the panel by double-clicking the icon.
Deploy Model to VEX V5 Robot Brain
After adding Display and Push Button blocks and connecting to the appropriate signal values or parameters, deploy the model to VEX V5 Robot Brain. Once you deploy the model, the panels display on the LCD touch-screen. The Push Button and Display blocks are visible in the panel added on the LCD touch-screen and you can perform the necessary actions. For example, you can press the button on the touch screen to initiate an action.
Even after successful deployment, if the Push Button and Display blocks does not appear on the device screen, ensure that the Push Button and Display blocks are placed inside the panel.
A sample screen of VEX V5 Robot Brain display is shown below. You can press the arrow keys on LCD touch-screen to navigate to the required Simulink panel.
Only Display and Push Button Simulink Dashboard blocks are supported in a Simulink panel.
Block parameters of the Display Simulink Dashboard blocks cannot be edited.
In the block parameters of the Push Button block, only the On Value parameter can be edited. Other values will not be honoured while rendering on the VEX V5 Robot Brain display.
If the model is running in external mode, then input blocks from the Dashboard library remain inactive on the screen.
Simulink Dashboard Blocks which are not present within the panel will not show in the VEX V5 display.