QtVCP can be used to create control panels that interface with HAL.

1. Builtin Virtual Control Panels

There are several builtin HAL panels available.

In a terminal type qtvcp list to see a list.

1.1. copy

Used for copying QtVCP’s builtin Screens/VCP Panels/QtVismach code to a folder so one can customize it.

In a terminal run:

qtvcp copy
QtVCP copy Dialog - Screen, Panel or Vismach Code Copy Panel
Figure 1. QtVCP copy Dialog - Screen, VCP Panel or QtVismach Code Copy Panel

1.2. test_dial

  • This panel has a dial that adjusts S32 and Float HAL output pins.

  • The dial’s range can be adjusted from a drop down menu.

  • The output can be scaled with the spinbox.

  • A combobox can be used to automatically select and connect to a signal.

loadusr qtvcp test_dial
QtVCP test_dial Panel - Test Dial VCP
Figure 2. QtVCP test_dial Panel - Test Dial VCP

1.3. test_button

  • This panel has a button that will set a HAL pin.

  • The button can be selected as a momentary or a toggle button.

  • The button’s indicator color can be adjusted from a drop down menu.

  • You can add more buttons from the drop down menu.

  • You can load a Halmeter from the drop down menu.

  • You can load a test LED from the drop down menu.

  • The button can be detached from the main windows.

Here is how to load test_button from a HAL script:

loadusr qtvcp test_button
loadusr qtvcp -o 4 test_button

The -o switch sets how many buttons the panel starts with.
If loading directly from a terminal omit the loadusr.

QtVCP test_button - Test Button VCP
Figure 3. QtVCP test_button - Test Button VCP

1.4. test_led

  • This panel has an LED that can selected to watch HAL bit pins/signals.

  • The LED’s color can be adjusted from a drop down menu.

  • The text box and state can be output as speech if sound is selected.

  • A combobox can be used to automatically select and connect to a pin/signal.

  • You can add more LEDs from the drop down menu.

  • The LED can be detached from the main windows.

Here is how to load test_led from a HAL script:

loadusr qtvcp test_led
loadusr qtvcp -o 4 test_led

The -o switch sets how many LEDs the panel starts with.
If loading directly from a terminal omit the loadusr.

QtVCP test_dial Panel - Test LED VCP
Figure 4. QtVCP test_dial Panel - Test LED VCP

1.5. test_panel

Collection of useful widgets for testing HAL component, including speech of LED state.

loadusr qtvcp test_panel
QtVCP test_panel - HAL Component Testing Panel
Figure 5. QtVCP test_panel - HAL Component Testing Panel

1.6. cam_align

A camera display widget for rotational alignment.

QtVCP cam_align Panel - Camera Based Alignment Panel
Figure 6. QtVCP cam_align Panel - Camera Based Alignment Panel
Usage

Add these lines to the INI file:

[DISPLAY]
EMBED_TAB_NAME = cam_align
EMBED_TAB_COMMAND = halcmd loadusr -Wn qtvcp_embed qtvcp -d -c qtvcp_embed -x {XID} cam_align
# The following line is needed if embedding in GMOCCAPY
EMBED_TAB_LOCATION = ntb_preview

You can add window width and height size, rotation increment, and camera number from the INI with -o options.

EMBED_TAB_COMMAND = halcmd loadusr -Wn qtvcp_embed qtvcp -d -c qtvcp_embed -x {XID} -o size=400,400 -o rotincr=.2 -o camnumber=0 cam_align

mouse controls:

  • left mouse single click - increase cross hair rotation one increment

  • right mouse single click - decrease cross hair rotation one increment

  • middle mouse single click - cycle through rotation increments

  • left mouse hold and scroll - scroll camera zoom

  • right mouse hold and scroll - scroll cross hair rotation angle

  • mouse scroll only - scroll circle diameter

  • left mouse double click - reset zoom

  • right mouse double click - reset rotation

  • middle mouse double click - reset circle diameter

To use the top buttons you have to assign a command (or a sub-routine). This could look like this:

[MDI_COMMAND_LIST]
MDI_COMMAND=G10 L20 P1 X0 Y0,Set XY\nOrigin
MDI_COMMAND=G0 X0 Y0,Go To\nOrigin

Where the first command is referring to the button "SET origin" and the second to the button "GOTO Origin".
Note the comma and text after is optional - it will override the default button text.
These buttons are Qtvcp action buttons and follow those rules.

1.7. sim_panel

Small control panel to simulate MPG jogging controls etc.
For simulated configurations

loadusr qtvcp sim_panel
QtVCP sim_panel - Simulated Controls Panel For Screen Testing
Figure 7. QtVCP sim_panel - Simulated Controls Panel For Screen Testing.

1.8. tool_dialog

Manual tool change dialog that gives tool description.

loadusr -Wn tool_dialog qtvcp -o speak_on -o audio_on tool_dialog

Options:

  • -o notify_on - use desktop notify dialogs instead of QtVCP native ones.

  • -o audio_on - play sound on tool change

  • -o speak_on - speak announcement of tool change

QtVCP tool_dialog - Manual Tool Change Dialog
Figure 8. QtVCP tool_dialog - Manual Tool Change Dialog

2. vismach 3D Simulation Panels

These panels are prebuilt simulation of common machine types.

These are also embed-able in other screens such as AXIS or GMOCCAPY.

2.1. QtVCP vismach_mill_xyz

3D OpenGL view of a 3-Axis milling machine.

loadusr qtvcp vismach_mill_xyz
QtVCP vismach_mill_xyz - 3-Axis Mill 3D View Panel
Figure 9. QtVCP vismach_mill_xyz - 3-Axis Mill 3D View Panel

2.2. QtVCP vismach_scara

3D OpenGL view of a SCARA based milling machine.

loadusr qtvcp vismach_scara
QtVCP vismach_scara - SCARA Mill 3D View Panel
Figure 10. QtVCP vismach_scara - SCARA Mill 3D View Panel

2.3. QtVCP vismach_millturn

3D OpenGL view of a 3-Axis milling machine with an A axis/spindle.

loadusr qtvcp vismach_millturn
QtVCP vismach_millturn - 4 Axis MillTurn 3D View Panel
Figure 11. QtVCP vismach_millturn - 4 Axis MillTurn 3D View Panel

2.4. QtVCP vismach_mill_5axis_gantry

3D OpenGL view of a 5-Axis gantry type milling machine.

loadusr qtvcp vismach_mill_5axis_gantry
QtVCP vismach_mill_5axis_gantry - 5-Axis Gantry Mill 3D View Panel
Figure 12. QtVCP vismach_mill_5axis_gantry - 5-AxIs Gantry Mill 3D View Panel

2.5. QtVCP vismach_fanuc_200f

3D openGL view of a 6 joint robotic arm.

loadusr qtvcp vismach_fanuc_200f
QtVCP vismach_fanuc_200f - 6 Joint Robotic Arm
Figure 13. QtVCP vismach_fanuc_200f - 6 Joint Robotic Arm

3. Custom Virtual Control Panels

You can of course make your own panel and load it.

If you made a UI file named my_panel.ui and a HAL file named my_panel.hal, you would then load this from a terminal with:

halrun -I -f my_panel.hal
Example HAL file loading a QtVCP panel
# load realtime components
loadrt threads
loadrt classicladder_rt

# load user space programs
loadusr classicladder
loadusr -Wn my_panel qtvcp my_panel.ui  # <1>

# add components to thread
addf classicladder.0.refresh thread1


# connect pins
net bit-input1     test_panel.checkbox_1        classicladder.0.in-00
net bit-hide       test_panel.checkbox_4        classicladder.0.hide_gui

net bit-output1    test_panel.led_1             classicladder.0.out-00

net s32-in1        test_panel.doublescale_1-s   classicladder.0.s32in-00

# start thread
start
  1. In this case we load qtvcp using -Wn which waits for the panel to finish loading before continuing to run the next HAL command.
    This is to ensure that the panel created HAL pins are actually done in case they are used in the rest of the file.