LinuxCNC Documentation
This page is 99% translated. Untranslated text is shown in English.

1. Вступ

Halui — це інтерфейс користувача на основі HAL для LinuxCNC, який з’єднує контакти HAL із командами NML. Більшість функцій (кнопки, індикатори тощо), що надаються традиційним графічним інтерфейсом користувача (AXIS, GMOCCAPY, QtDragon тощо), у Halui забезпечуються контактами HAL.

Найпростіший спосіб додати halui – це додати наступний код до розділу [HAL] INI-файлу:

[HAL]
HALUI = halui

Альтернативний спосіб його виклику (особливо якщо ви генеруєте конфігурацію за допомогою StepConf) – це включити наступне у ваш файл custom.hal.
Переконайтеся, що ви використовуєте правильний шлях до вашого INI-файлу.

loadusr halui -ini /path/to/inifile.ini

2. MDI

Іноді користувач хоче додати складніші завдання, які будуть виконуватися активацією виводу HAL. Це можливо шляхом додавання команд MDI до INI-файлу в розділі [HALUI]. Приклад:

[HALUI]
MDI_COMMAND = G0 X0
MDI_COMMAND = G0 G53 Z0
MDI_COMMAND = G28
MDI_COMMAND = o<mysub>call
# ...

Коли halui запускається, він зчитує поля MDI_COMMAND в INI і експортує контакти від 00 до кількості MDI_COMMAND, знайдених в INI, максимум до 64 команд. Ці контакти можна підключати як будь-які контакти HAL. Поширеним методом є використання кнопок, що надаються віртуальними панелями керування, як показано в прикладі Приклад підключень MDI_COMMAND.

Example 1. Приклад для з’єднань MDI_COMMAND
HAL-файл
net quill-up      halui.mdi-command-00 <= pyvcp.quillup
net reference-pos halui.mdi-command-01 <= pyvcp.referencepos
net call-mysub    halui.mdi-command-02 <= pyvcp.callmysub
Мережі, що з’єднують виводи halui.mdi-command-NN, надані halui.
$ halcmd show pin halui.mdi
Component Pins:
Owner  Type  Dir Value  Name
   10  bool  IN  FALSE  halui.mdi-command-00 <== quill-up
   10  bool  IN  FALSE  halui.mdi-command-01 <== reference-pos
   10  bool  IN  FALSE  halui.mdi-command-02 <== call-mysub
    ...

Коли контакт halui MDI встановлений (імпульсний) у стан «істина», halui надсилає команду MDI, визначену в INI. Це не завжди буде успішним, залежно від поточного режиму роботи (наприклад, у режимі AUTO halui не може успішно надсилати команди MDI).

3. Приклад конфігурації

Приклад конфігурації sim (configs/sim/axis/halui_pyvcp/halui.ini) включено до дистрибутиву.

4. Довідка про піни Halui

Усі піни halui також задокументовані на сторінці довідки halui:

$ man halui

4.1. Перервати

  • halui.abort (bool, in) - pin to send an abort message (clears out most errors)

4.2. E-Стій

  • halui.estop.activate (bool, in) - pin for requesting E-Stop

  • halui.estop.is-activated (bool, out) - indicates E-stop reset

  • halui.estop.reset (bool, in) - pin for requesting E-Stop reset

4.3. Перевизначення каналу

  • halui.feed-override.count-enable (bool, in) - must be true for counts or direct-value to work.

  • halui.feed-override.counts (sint, in) - counts * scale = FO percentage. Can be used with an encoder or direct-value.

  • halui.feed-override.decrease (bool, in) - pin for decreasing the FO (-=scale)

  • halui.feed-override.increase (bool, in) - pin for increasing the FO (+=scale)

  • halui.feed-override.reset (bool, in) - pin for resetting the FO (scale=1.0)

  • halui.feed-override.direct-value (bool, in) - false when using encoder to change counts, true when setting counts directly.

  • halui.feed-override.scale (real, in) - pin for setting the scale for increase and decrease of feed-override.

  • halui.feed-override.value (real, out) - current FO value

4.4. Туман

  • halui.mist.is-on (bool, out) - indicates mist is on

  • halui.mist.off (bool, in) - pin for requesting mist off

  • halui.mist.on (bool, in) - pin for requesting mist on

4.5. Повінь

  • halui.flood.is-on (bool, out) - indicates flood is on

  • halui.flood.off (bool, in) - pin for requesting flood off

  • halui.flood.on (bool, in) - pin for requesting flood on

4.6. Самонаведення

  • halui.home-all (bool, in) - pin for requesting all axis to home. This pin will only be there if HOME_SEQUENCE is set in the INI file.

4.7. Машина

  • halui.machine.units-per-mm (real out) - pin for machine units-per-mm (inch:1/25.4, mm:1) according to inifile setting: [TRAJ]LINEAR_UNITS

  • halui.machine.is-on (bool, out) - indicates machine on

  • halui.machine.off (bool, in) - pin for requesting machine off

  • halui.machine.on (bool, in) - pin for requesting machine on

4.8. Максимальна швидкість

Максимальну лінійну швидкість можна налаштувати від 0 до MAX_VELOCITY, встановленого в розділі [TRAJ] INI-файлу.

  • halui.max-velocity.count-enable (bool, in) - must be true for counts or direct-value to work.

  • halui.max-velocity.counts (sint, in) - counts * scale = MV percentage. Can be used with an encoder or direct-value.

  • halui.max-velocity.direct-value (bool, in) - false when using encoder to change counts, true when setting counts directly.

  • halui.max-velocity.decrease (bool, in) - pin for decreasing max velocity

  • halui.max-velocity.increase (bool, in) - pin for increasing max velocity

  • halui.max-velocity.scale (real, in) - the amount applied to the current maximum velocity with each transition from off to on of the increase or decrease pin in machine units per second.

  • halui.max-velocity.value (real, out) - is the maximum linear velocity in machine units per second.

4.9. MDI

  • halui.mdi-command-<nn> (bool, in) - halui will try to send the MDI command defined in the INI. <nn> is a two digit number starting at 00.
    If the command succeeds then it will place LinuxCNC in the MDI mode and then back to Manual mode.
    If no [HALUI]MDI_COMMAND variables are set in the ini file, no halui.mdi-command-<nn> pins will be exported by halui.

  • halui.halui-mdi-is-running (bool, out) - execution status of MDI commands sent by halui. The status is active even during mode switching. If no [HALUI]MDI_COMMAND variables are set in the ini file, this pins will not be exported by halui.

4.10. Суглоб

N = joint number (0 …​ num_joints-1)
Приклад:

  • halui.joint.N.select (bool in) - pin for selecting joint N

  • halui.joint.N.is-selected (bool out) - status pin that joint N is selected

  • halui.joint.N.has-fault (bool out) - status pin telling that joint N has a fault

  • halui.joint.N.home (bool in) - pin for homing joint N

  • halui.joint.N.is-homed (bool out) - status pin telling that joint N is homed

  • halui.joint.N.on-hard-max-limit (bool out) - status pin telling that joint N is on the positive hardware limit

  • halui.joint.N.on-hard-min-limit (bool out) - status pin telling that joint N is on the negative hardware limit

  • halui.joint.N.on-soft-max-limit (bool out) - status pin telling that joint N is on the positive software limit

  • halui.joint.N.on-soft-min-limit (bool out) - status pin telling that joint N is on the negative software limit

  • halui.joint.N.override-limits (bool out) - status pin telling that joint N's limits are temporarily overridden

  • halui.joint.N.unhome (bool in) - pin for unhoming joint N

  • halui.joint.selected (uint out) - selected joint number (0 …​ num_joints-1)

  • halui.joint.selected.has-fault (bool out) - status pin selected joint is faulted

  • halui.joint.selected.home (bool in) - pin for homing the selected joint

  • halui.joint.selected.is-homed (bool out) - status pin telling that the selected joint is homed

  • halui.joint.selected.on-hard-max-limit (bool out) - status pin telling that the selected joint is on the positive hardware limit

  • halui.joint.selected.on-hard-min-limit (bool out) - status pin telling that the selected joint is on the negative hardware limit

  • halui.joint.selected.on-soft-max-limit (bool out) - status pin telling that the selected joint is on the positive software limit

  • halui.joint.selected.on-soft-min-limit (bool out) - status pin telling that the selected joint is on the negative software limit

  • halui.joint.selected.override-limits (bool out) - status pin telling that the selected joint’s limits are temporarily overridden

  • halui.joint.selected.unhome (bool in) - pin for unhoming the selected joint

4.11. Суглобовий біг

N = номер суглоба (0 …​ кількість_суглобів-1)

  • halui.joint.jog-deadband (real in) - pin for setting jog analog deadband (jog analog inputs smaller/slower than this - in absolute value - are ignored)

  • halui.joint.jog-speed (real in) - pin for setting jog speed for plus/minus jogging.

  • halui.joint.N.analog (real in) - pin for jogging the joint N using a real value (e.g. joy-stick). The value, typically set between 0.0 and ±1.0, is used as a jog-speed multiplier.

  • halui.joint.N.increment (real in) - pin for setting the jog increment for joint N when using increment-plus/minus

  • halui.joint.N.increment-minus (bool in) - a rising edge will will make joint N jog in the negative direction by the increment amount

  • halui.joint.N.increment-plus (bool in) - a rising edge will will make joint N jog in the positive direction by the increment amount

  • halui.joint.N.minus (bool in) - pin for jogging joint N in negative direction at the halui.joint.jog-speed velocity

  • halui.joint.N.plus (bool in) - pin for jogging joint N in positive direction at the halui.joint.jog-speed velocity

  • halui.joint.selected.increment (real in) - pin for setting the jog increment for the selected joint when using increment-plus/minus

  • halui.joint.selected.increment-minus (bool in) - a rising edge will will make the selected joint jog in the negative direction by the increment amount

  • halui.joint.selected.increment-plus (bool in) - a rising edge will will make the selected joint jog in the positive direction by the increment amount

  • halui.joint.selected.minus (bool in) - pin for jogging the selected joint in negative direction at the halui.joint.jog-speed velocity

  • halui.joint.selected.plus (bool in) - pin for jogging the selected joint in positive direction at the halui.joint.jog-speed velocity

4.12. Вісь

L = axis letter (xyzabcuvw)

  • halui.axis.L.select (bool in) - pin for selecting axis by letter

  • halui.axis.L.is-selected (bool out) - status pin that axis L is selected

  • halui.axis.L.pos-commanded (real out) - Commanded axis position in machine coordinates

  • halui.axis.L.pos-feedback (real out) - Feedback axis position in machine coordinates

  • halui.axis.L.pos-relative (real out) - Feedback axis position in relative coordinates

4.13. Біг по осі

L = axis letter (xyzabcuvw)

  • halui.axis.jog-deadband (real in) - pin for setting jog analog deadband (jog analog inputs smaller/slower than this (in absolute value) are ignored)

  • halui.axis.jog-speed (real in) - pin for setting jog speed for plus/minus jogging.

  • halui.axis.L.analog (real in) - pin for jogging the axis L using a real value (e.g. joystick). The value, typically set between 0.0 and ±1.0, is used as a jog-speed multiplier.

  • halui.axis.L.increment (real in) - pin for setting the jog increment for axis L when using increment-plus/minus

  • halui.axis.L.increment-minus (bool in) - a rising edge will will make axis L jog in the negative direction by the increment amount

  • halui.axis.L.increment-plus (bool in) - a rising edge will will make axis L jog in the positive direction by the increment amount

  • halui.axis.L.minus (bool in) - pin for jogging axis L in negative direction at the halui.axis.jog-speed velocity

  • halui.axis.L.plus (bool in) - pin for jogging axis L in positive direction at the halui.axis.jog-speed velocity

  • halui.axis.selected (uint out) - selected axis (by index: 0:x 1:y 2:z 3:a 4:b 5:cr 6:u 7:v 8:w)

  • halui.axis.selected.increment (real in) - pin for setting the jog increment for the selected axis when using increment-plus/minus

  • halui.axis.selected.increment-minus (bool in) - a rising edge will will make the selected axis jog in the negative direction by the increment amount

  • halui.axis.selected.increment-plus (bool in) - a rising edge will will make the selected axis jog in the positive direction by the increment amount

  • halui.axis.selected.minus (bool in) - pin for jogging the selected axis in negative direction at the halui.axis.jog-speed velocity

  • halui.axis.selected.plus (bool in) - for jogging the selected axis in positive direction at the halui.axis.jog-speed velocity

4.14. Режим

  • halui.mode.auto (bool, in) - pin for requesting auto mode

  • halui.mode.is-auto (bool, out) - indicates auto mode is on

  • halui.mode.is-joint (bool, out) - indicates joint by joint jog mode is on

  • halui.mode.is-manual (bool, out) - indicates manual mode is on

  • halui.mode.is-mdi (bool, out) - indicates MDI mode is on

  • halui.mode.is-teleop (bool, out) - indicates coordinated jog mode is on

  • halui.mode.joint (bool, in) - pin for requesting joint by joint jog mode

  • halui.mode.manual (bool, in) - pin for requesting manual mode

  • halui.mode.mdi (bool, in) - pin for requesting MDI mode

  • halui.mode.teleop (bool, in) - pin for requesting coordinated jog mode

4.15. Програма

  • halui.program.block-delete.is-on (bool, out) - status pin telling that block delete is on

  • halui.program.block-delete.off (bool, in) - pin for requesting that block delete is off

  • halui.program.block-delete.on (bool, in) - pin for requesting that block delete is on

  • halui.program.is-idle (bool, out) - status pin telling that no program is running

  • halui.program.is-paused (bool, out) - status pin telling that a program is paused

  • halui.program.is-running (bool, out) - status pin telling that a program is running

  • halui.program.optional-stop.is-on (bool, out) - status pin telling that the optional stop is on

  • halui.program.optional-stop.off (bool, in) - pin requesting that the optional stop is off

  • halui.program.optional-stop.on (bool, in) - pin requesting that the optional stop is on

  • halui.program.pause (bool, in) - pin for pausing a program

  • halui.program.resume (bool, in) - pin for resuming a paused program

  • halui.program.run (bool, in) - pin for running a program

  • halui.program.step (bool, in) - pin for stepping in a program

  • halui.program.stop (bool, in) - pin for stopping a program

4.16. Швидке перевизначення

  • halui.rapid-override.count-enable (bool in (default: TRUE)) - When TRUE, modify Rapid Override when counts changes.

  • halui.rapid-override.counts (sint in) - counts X scale = Rapid Override percentage. Can be used with an encoder or direct-value.

  • halui.rapid-override.decrease (bool in) - pin for decreasing the Rapid Override (-=scale)

  • halui.rapid-override.direct-value (bool in) - pin to enable direct value Rapid Override input

  • halui.rapid-override.increase (bool in) - pin for increasing the Rapid Override (+=scale)

  • halui.rapid-override.scale (real in) - pin for setting the scale on changing the Rapid Override

  • halui.rapid-override.value (real out) - current Rapid Override value

  • halui.rapid-override.reset (bool, in) - pin for resetting the Rapid Override value (scale=1.0)

4.17. Корекції шпинделя

  • halui.spindle.N.override.count-enable (bool, in) - must be true for counts or direct-value to work.

  • halui.spindle.N.override.counts (sint, in) - counts * scale = SO percentage. Can be used with an encoder or direct-value.

  • halui.spindle.N.override.decrease (bool, in) - pin for decreasing the SO (-=scale)

  • halui.spindle.N.override.direct-value (bool, in) - false when using encoder to change counts, true when setting counts directly.

  • halui.spindle.N.override.increase (bool, in) - pin for increasing the SO (+=scale)

  • halui.spindle.N.override.scale (real, in) - pin for setting the scale on changing the SO

  • halui.spindle.N.override.value (real, out) - current SO value

  • halui.spindle.N.override.reset (bool, in) - pin for resetting the SO value (scale=1.0)

4.18. Шпиндель

  • halui.spindle.N.brake-is-on (bool, out) - indicates brake is on

  • halui.spindle.N.brake-off (bool, in) - pin for deactivating spindle/brake

  • halui.spindle.N.brake-on (bool, in) - pin for activating spindle-brake

  • halui.spindle.N.decrease (bool, in) - decreases spindle speed

  • halui.spindle.N.forward (bool, in) - starts the spindle with CW motion

  • halui.spindle.N.increase (bool, in)- increases spindle speed

  • halui.spindle.N.is-on (bool, out) - indicates spindle is on (either direction)

  • halui.spindle.N.reverse (bool, in)- starts the spindle with a CCW motion

  • halui.spindle.N.runs-backward (bool, out) - indicates spindle is on, and in reverse

  • halui.spindle.N.runs-forward (bool, out) - indicates spindle is on, and in forward

  • halui.spindle.N.start (bool, in) - starts the spindle

  • halui.spindle.N.stop (bool, in) - stops the spindle

4.19. Інструмент

  • halui.tool.length-offset.a (real out) - current applied tool length offset for the A axis

  • halui.tool.length-offset.b (real out) - current applied tool length offset for the B axis

  • halui.tool.length-offset.c (real out) - current applied tool length offset for the C axis

  • halui.tool.length-offset.u (real out) - current applied tool length offset for the U axis

  • halui.tool.length-offset.v (real out) - current applied tool length offset for the V axis

  • halui.tool.length-offset.w (real out) - current applied tool length offset for the W axis

  • halui.tool.length-offset.x (real out) - current applied tool length offset for the X axis

  • halui.tool.length-offset.y (real out) - current applied tool length offset for the Y axis

  • halui.tool.length-offset.z (real out) - current applied tool length offset for the Z axis

  • halui.tool.diameter (real out) - Current tool diameter, or 0 if no tool is loaded.

  • halui.tool.number (uint, out) - indicates current selected tool