INI Settings

Video Tutorial

[EMC]

The optional DEBUG key in the [EMC] section can be used to show various levels of debug information when running in a terminal. The DEBUG key is not required.

DEBUG = option number

Debug Options

EMC_DEBUG_CONFIG               2
EMC_DEBUG_VERSIONS             8
EMC_DEBUG_TASK_ISSUE          10
EMC_DEBUG_NML                 40
EMC_DEBUG_MOTION_TIME         80
EMC_DEBUG_INTERP             100
EMC_DEBUG_RCS                200
EMC_DEBUG_INTERP_LIST        800
EMC_DEBUG_IOCONTROL         1000
EMC_DEBUG_OWORD             2000
EMC_DEBUG_REMAP             4000
EMC_DEBUG_PYTHON            8000
EMC_DEBUG_NAMEDPARAM       10000
EMC_DEBUG_GDBONSIGNAL      20000
EMC_DEBUG_STATE_TAGS       80000
EMC_DEBUG_UNCONDITIONAL 40000000
EMC_DEBUG_ALL           7FFFFFFF

[DISPLAY]

In the [DISPLAY] section of the .ini file you can tell LinuxCNC to use Flex GUI and which .ui file to load.

Flex GUI

To use the Flex GUI (as opposed to Axis or others), change the DISPLAY value to

DISPLAY = flexgui

If no GUI is specified then the default GUI will be used.

Note

Any Flex GUI .ui and .qss files must be in the same LinuxCNC configuration directory as the .ini file.

To use your .ui file (created with Qt Designer), add a GUI key to the .ini with its filename

GUI = my-file-name.ui

Startup File

To automatically open a NC file on startup, add the OPEN_FILE key with any valid path. Use ~/ as a shortcut to the users home directory. Use ./ to indicate that the file is in the configuration directory

Full Path to the file
OPEN_FILE = /home/john/linuxcnc/configs/myconfig/welcome.ngc
or use the ~ for the users home directory
OPEN_FILE = ~/linuxcnc/configs/flex_examples/probe_sim/square.ngc
or use the ./ to use the current configuration directory
OPEN_FILE = ./welcome.ngc
or use the ../ to use the parent directory of the configuration
OPEN_FILE = ../welcome.ngc

File Location

Likewise, to specify a default location for NC files, add the PROGRAM_PREFIX item.

Full Path to the file
PROGRAM_PREFIX = /home/john/linuxcnc/my_files
or use the ~ for the users home directory
PROGRAM_PREFIX = ~/linuxcnc/my_files
or use the ./ to use the current configuration directory
PROGRAM_PREFIX = ./my_local_files
or use the ../ to use the parent directory of the configuration
PROGRAM_PREFIX = ../my_files

Tool Table Editor

To specify a different tool table editor add an entry to the [DISPLAY] section. If no entry is found then the default tool editor is used

TOOL_EDITOR = tooledit

To control the columns displayed by the default tool editor add any of the valid column specifiers separated by a space.

TOOL_EDITOR = tooledit x y z a b c u v w diam front back orien

If no entry is found then the axes in the configuration and diameter are shown. Tool, Pocket and Comment are always shown.

File Extensions

The keyboard file dialog defaults to *.ngc and this ignores case. To specify the file extensions you want the file dialog to show, add an EXTENSIONS key with the desired extensions separated by a comma. The extensions must be in the format *.ext with the asterisk and dot

EXTENSIONS = `*.nc`, `*.G-code`, `*.ngc`, `*.txt`

[FLEXGUI]

Cycle Time

The update cycle time can be set to 50-200 ms using the CYCLE_TIME key. If the CYCLE_TIME key is not found in the [FLEXGUI] section the cycle time will be set to 100 ms. A slower computer may benifit from a longer cycle time.

CYCLE_TIME = 100

Splash Screen

You can add a splash screen with custom title and time to flex. The image file name is the only required item. If title and time are not specified then the default Flex Dragon Slayer and 5 seconds are used. The image file must be in the configuration directory. If the image is a jpg you might have to open it in GIMP and save it as png if it does not show up. If the font is not an exact match the nearest font will be used. Some fixed width fonts are Monospace and Courier. Some variable width fonts are Cantarell and Serif. Font colors are simple base colors only.

SPLASH_IMAGE = name.png
SPLASH_TITLE = Flex
SPLASH_TIME = 10
SPLASH_FONT = Name of Font
SPLASH_FONT_SIZE = 12
SPLASH_FONT_BOLD = True or False
SPLASH_FONT_COLOR = black

Flash Timer

The Flash Timer default is 1000ms to change it add the following to the [FLEXGUI] section. The value is in ms so 500 is 0.5 seconds.

FLASH_TIME = 500

Themes

Themes are just style sheets that get applied to the widgets. The theme files are in the themes directory of the example files if you want to copy and customize one of the themes.

blue.qss
blue-touch.qss
dark.qss
dark-touch.qss
keyboard.qss
touch.qss

To use a built-in theme with no color changes add one of the following to the [FLEXGUI] section of the ini file.

THEME = touch
THEME = keyboard

To use a built in theme with coloring add one of the following to the [FLEXGUI] section of the ini file.

THEME = blue
THEME = blue-touch
THEME = dark
THEME = dark-touch

Note

Touch themes use tabs set to South for rounding and non touch use tabs set to North.

Note

THEME is checked first then QSS so the first entry found is used.

Jog velocity settings are in [TRAJ] LINEAR_UNITS per second. These settings will setup the jog velocity slider minimum, maximum and setting at startup.

MIN_JOG_VELOCITY = 0.1
DEFAULT_JOG_VELOCITY = 0.2
MAX_JOG_VELOCITY = 1.0

Keyboard Jog

Keyboard Jog options can be added by adding the following to the INI file in the [FLEXGUI] section.

See Keyboard Jog for more information.

KEYBOARD_JOG = True
KB_JOG_INCREMENT = True
KB_JOG_FOCUS = True

Style Sheet

To use a custom .qss style sheet you created add the name of the stylesheet to the QSS option in [FLEXGUI] section of the ini file.

QSS = name_of_stylesheet.qss

For more information on style sheets see StyleSheet

Resource File

To use a .py resource file (to add images to buttons with your qss stylesheet) place the .py resource file in the configuration directory and add the following line to the .ini file

RESOURCES = resources.py

See the Resources section for more info.

Screen Size

To control the initial size of the screen, add of the following values.

SIZE = minimized
SIZE = normal
SIZE = maximized
SIZE = full
SIZE = rpi_full

Note

the values are case sensitive

Note

The Raspberry Pi 5 with Wayland needs to use the rpi_full value

Warning

Full size screen does not have any window controls. Make sure there is a way to close the GUI like an Exit button or you may not be able to close the application. As a last-resort, pressing ALT-F4 will close it.

Plotter

The plotter background color can be set in the [FLEXGUI] section of the ini. The value is the Red,Green,Blue color numbers from 0 to 1 with no space. So an entry of 0.0,0.0,0.0 is black and 1.0,1.0,1.0 is white. Use a RGB 0-1 Color Picker to select the RGB values.

[FLEXGUI]
PLOT_BACKGROUND_COLOR = 0.0,0.0,0.0

The plotter orientation can be set to one of the following x, x2, y, y2, z, or p.

[FLEXGUI]
PLOT_VIEW = x

The font size for the plotter can be set in the ini by adding the following to the FLEXGUI section. The font size must be an integer.

[FLEXGUI]
DRO_FONT_SIZE = 12

The plotter DRO can be set to automatically change units when the program units G20/G21 change. Setting to True disables the manual unit change controls.

[FLEXGUI]
PLOT_UNITS = True

The plot grid sizes are set in the ini file. Fraction and decimal numbers are valid. Fractions are always in Inch units. Valid suffixes are mm, cm, um, in, inch, mil. If fraction does not have a suffix then inch will be added as the suffix. If no suffix is found the the machine units suffix will be added. If the size does not have a valid suffix or is not a number it will be skipped and a warning will appear.

[FLEXGUI]
PLOT_GRID = 1/2, 1 in, 1 1/2, 2 inch
or for metric
PLOT_GRID = 10mm, 20mm, 50mm, 100mm

The first item in the list will be considered the default and set when FlexGUI starts. If you wish disable grid by default, add a 0 item to the beginning of the list.

DRO

To set the DRO labels to follow the program units add the following

[FLEXGUI]
DRO_UNITS = True

Jog Increments

The Jog Increments Combobox is populated from the JOG_INCREMENTS entry. Units can be mm, cm, um, in, inch, mil or left out. A space can be between the distance and the units for better readability. Fractions are are in inch units and can be a whole number with a space then the fraction.

[FLEXGUI]
JOG_INCREMENTS = 0.250, 0.100, 0.010, 0.001
or
JOG_INCREMENTS = 1 1/2, 1 inch, 0.5 in, 1 cm, 1 mm

Warning

[FLEXGUI] JOG_INCREMENTS must be a comma seperated list or it will be ignored.

Note

Jog incremnts can have unit labels, the following are valid unit labels cm, mm, um, inch, in or mil. If no unit labels are found the the configuration units are used.

LED Defaults

LED buttons can have defaults set in the ini file. This makes it easier to have consistent LED size, position and colors. These options go in the [FLEXGUI] section.

The color options can be specified using HEX, RGB or RGBA.

Valid RGB(A) Red, Green, Blue (Alpha) values are 0 to 255.

Valid HEX values are #000000 to #ffffff

In PyQt6 the Alpha channel is 0 to 255. 0 represents a fully transparent color, while 255 represents a fully opaque color. If Alpha is ommitted then it’s set to fully opaque or 255.

The Diameter and Offset values are whole numbers only.

[FLEXGUI]
LED_DIAMETER = 15
LED_RIGHT_OFFSET = 5
LED_TOP_OFFSET = 5
LED_ON_COLOR = 0, 255, 0
LED_OFF_COLOR= 125, 0, 0, 255

For more information see LED Buttons

NEW 2.0

HAL LED Text labels can have background and text colors based on the state of the HAL pin.

HAL LED Text Labels can have default colors for the background and text set in the INI file. As above the colors can be HEX, RGB or RGBA.

[FLEXGUI]
LED_ON_BG_COLOR = 0, 255, 0
LED_OFF_BG_COLOR= 125, 0, 0, 255
LED_ON_TEXT_COLOR = 0, 255, 0
LED_OFF_TEXT_COLOR= #000000

Touch Screens

Options for touch screen users.

To set the style sheet used by the popup number pad, NC code pad and popup keyboard add the following to the FLEXGUI section with the name of the .qss stylesheet to use. If POPUP_QSS is not found then the default .qss file will be used.

[FLEXGUI]
POPUP_QSS = somefile.qss

Set the touch screen file chooser to automatically adjust the width by adding the following to the FLEXGUI section.

[FLEXGUI]
TOUCH_FILE_WIDTH = True

Add popup keypad to all spin boxes.

[FLEXGUI]
TOUCH_SPINBOX = True

To add a manual tool change popup to add the following to the ini file in the [FLEXGUI] section.

[FLEXGUI]
MANUAL_TOOL_CHANGE = True

Keyboard Shortcuts

To add keyboard jog increment to Flex GUI add the following to the FLEXGUI section. The keys 0 through the maximum index position will set the index position in the Jog Modes Combobox. A maximum of 10 positions can be used 0-9. The Jog Modes Combobox must have jog increments set in the INI section [FLEXGUI] JOG_INCREMENTS.

To change the jog increment the control must be out of E-Stop and in manual mode and the Ctrl key must be pressed and held as you press a number key.

[FLEXGUI]
KB_JOG_INCREMENT = True

I/O

LinuxCNC defaults to 4 each of Digital I/O and Analog I/O. If you configured to have more than 4 Digital I/O or Analog I/Os and you want to track them in Flex GUI you must tell Flex how many you have configured.

[FLEXGUI]
DIO = Number of Digital I/O
AIO = Number of Analog I/O

[SPINDLE_n]

The spindles are numbered 0-7 so replace the n with the spindle number. The default spindle is spindle 0. If any of these are not found the default values show here will be used.

MIN_RPM = 0
MAX_RPM = 1000
INCREMENT = 100
MIN_OVERRIDE = 0
MAX_OVERRIDE = 100
DEFAULT_RPM = 0

The keys MIN_RPM and MAX_RPM set the minimum and maximum RPM for the spindle. The INCREMENT key sets the increment for the faster, slower controls and the speed spinbox up/down arrow key increment.

The MIN_OVERRIDE and MAX_OVERRIDE set the limits for the spindle speed override slider. The value is the percent of override to allow. So if you set MIN_OVERRIDE to 50 the minimum speed override is 50% of the current programmed or manual setting of the spindle. The key MAX_OVERRIDE must be set at 100 or higher.

The DEFAULT_RPM will be the RPM setting at startup.

[HAL]

To make HAL connections to Flex GUI HAL objects it must be done in the post gui HAL file and the file must be added to the [HAL] section of the ini file.

POSTGUI_HALFILE = postgui.hal