diff --git a/docs/src/code/writing-tests.adoc b/docs/src/code/writing-tests.adoc index cefd3cc1d3b..2f3dfd15f92 100644 --- a/docs/src/code/writing-tests.adoc +++ b/docs/src/code/writing-tests.adoc @@ -21,8 +21,7 @@ locate tests to run under `tests/`, but can be limited to only run a limited set of tests by specifying the directory of the test or tests as argument(s). -Here is an example running only the tests in `tests/lathe/` - +.An example running only the tests in `tests/lathe/`. ---- $ scripts/runtests tests/lathe/ Running test: tests/lathe @@ -34,8 +33,7 @@ _test.hal_ below the directories specified on the command line, or under `tests/` if no command line argument is specified. These files represent three different ways to run the tests. -The _runtests_ script accepts the following arguments, see the output -from `scripts/runtests -h` for the authoritative list: +.Arguments accepted by the _runtests_ script, see the output from `scripts/runtests -h` for the authoritative list. ---- -n do not remove temporary files for successful tests. -s stop after any failed test. @@ -44,10 +42,11 @@ from `scripts/runtests -h` for the authoritative list: -u Only run tests that require normal user access. -v Show stdout and stderr (normally it's hidden). ---- + == Writing tests Make sure the test can run successfully without a working X11 display, -i.e. with the DISPLAY environment variable unset. +i.e., with the DISPLAY environment variable unset. 1. Create a folder in `tests/`. 2. Provide one test script. diff --git a/docs/src/getting-started/getting-linuxcnc.adoc b/docs/src/getting-started/getting-linuxcnc.adoc index 2db9b525ef0..80eba40ffa1 100644 --- a/docs/src/getting-started/getting-linuxcnc.adoc +++ b/docs/src/getting-started/getting-linuxcnc.adoc @@ -4,7 +4,7 @@ [[cha:getting-linuxcnc]] = Getting LinuxCNC(((Getting LinuxCNC))) -This section describes how to install LinuxCNC version 2.9 on a PC already running Debian Bookworm (Debian 12). Linuxcnc requires the PREEMPT_RT real time kernel to ensure the strict timing required for CNC operations are met. We will also cover how to install Debian Bookworm optimised for Linuxcnc on the x86/AMD64 and ARM64 platforms for first time users. We will also cover some troubleshooting steps and common problems you may experience. +This section describes how to install LinuxCNC version 2.9 on a PC already running Debian Bookworm (Debian 12). LinuxCNC requires the PREEMPT_RT real time kernel to ensure the strict timing required for CNC operations are met. We will also cover how to install Debian Bookworm optimised for LinuxCNC on the x86/AMD64 and ARM64 platforms for first time users. We will also cover some troubleshooting steps and common problems you may experience. NOTE: The PREEMPT_RT kernel is a dependency of LinuxCNC so on most computer platforms, eg AMD64/x86, it will be installed with LinuxCNC. On some platforms such as the Raspberry Pi, it needs to be installed separately. Some environments (eg. Armbian) may support installation of Debian Bookworm but require special procedures to install PREEMPT_RT which are beyond the scope of this document. @@ -37,7 +37,7 @@ Optionally you can install mesaflash if you are using a Mesa card: sudo apt install mesaflash ---- Reboot and log in again as the same user. -Open a terminal window and check PREEMPT_RT is installed +Open a terminal window and check PREEMPT_RT is installed: ---- uname -v @@ -53,20 +53,20 @@ That's it! You are done! You will find LinuxCNC under the CNC menu. . Download a Debian Boookworm ISO. There are two versions to consider. .. The small netinst .ISO that requires a connection to the internet during the installation (recommended) https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.1.0-amd64-netinst.iso .. The much larger full live install that includes everything in Debian (use if you do not have an internet connection). https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-12.1.0-amd64-xfce.iso -. Burn the Debian Image to a USB drive using Balena Etcher -. Connect the PC to install Linuxcnc on to a wired internet connection (only use wifi if you must) +. Burn the Debian Image to a USB drive using Balena Etcher. +. Connect the PC to install LinuxCNC on to a wired internet connection (only use wifi if you must). . Boot the PC from the USB image. This may require changing the boot order to boot from a USB first. -. Follow the prompts to install Debian Bookworm -. When asked to partition the drive, use all of the available space and install all files on one partition -. Do NOT add a password to the root account +. Follow the prompts to install Debian Bookworm. +. When asked to partition the drive, use all of the available space and install all files on one partition. +. Do NOT add a password to the root account. [WARNING] Do not enter a root password, if you do sudo is disabled and you won't be able to install software. -. When asked to install a desktop environment during the netinst installation , Choose XFCE and deselect other desktops. -. When complete, install Linuxcnc following the steps above. +. When asked to install a desktop environment during the netinst installation, choose XFCE and deselect other desktops. +. When complete, install LinuxCNC following the steps above. -== Install Debian Bookworm on a Raspberry Pi -NOTE: Raspberry Pis (and most other Single Board Computers, or SBUs) are ARM64 machines. These instructions will feature arm64 kernel and can't be used for AMD64 machines (which is what many PCs are, including all Intel based machines.) +== Install Debian Bookworm on a Raspberry Pi +NOTE: Raspberry Pis (and most other Single Board Computers, or SBUs) are ARM64 machines. These instructions will feature arm64 kernel and can't be used for AMD64 machines (which is what many PCs are, including all Intel based machines). . Download a Debian Bookworm image from https://raspi.debian.net/daily-images/ and burn to an SD card and install in the https://www.raspberrypi.org/documentation/installation/installing-images/README.md[usual way]. @@ -74,7 +74,7 @@ NOTE: Raspberry Pis (and most other Single Board Computers, or SBUs) are ARM64 m NOTE: There have been reported black screen lockout with the "tested" images on some Pis. It may be that removing dtoverlay=vc4-fkms-v3d-pi4 from /boot/config.txt resolves that problem. These instructions were tested using the 2023/05/15 daily build. -. Ensure the Pi is connected to the internet. Boot the Pi. It will open a text based terminal +. Ensure the Pi is connected to the internet. Boot the Pi. It will open a text based terminal. . Login using the root account (which does not have a password yet). Type: ---- @@ -191,7 +191,10 @@ autologin-user=matt autologin-user-timeout=0 ---- == PREEMPT_RT Tweaks (x86/AMD64 only) -isolcpus can make a huge difference to latency on some systems because it isolates specific CPU cores so they are purely used by real time threads (eg the linuxcnc servo thread). The instructions below assume a 4 core CPU eg. Celeron, i3, i5 etc) those with 2 cores or more than 4 cores need different isolcpus settings. It is best to never isolate core 0 as it is used for system threads so it already includes a lot of running threads. +isolcpus can make a huge difference to latency on some systems, because it isolates specific CPU cores so they are purely used by real time threads (e.g. the LinuxCNC servo thread). +The instructions below assume a 4 core CPU, e.g. Celeron, i3, i5, etc. +Those with 2 cores or more than 4 cores need different isolcpus settings. +It is best to never isolate core 0 as it is used for system threads so it already includes a lot of running threads. Isolate 2 cores for better RT performance on a 4 core machine. ---- @@ -212,7 +215,7 @@ Use latency-histogram instead of latency-test to review latency particularly if ---- latency-histogram --nobase --sbins 1000 ---- -How to evaluate latency is covered in the linuxcnc documents +How to evaluate latency is covered in the LinuxCNC documents Among other things, latency is affected by: BIOS settings; Isolcpus and other boot time settings; Kernel version used NOTE: Optimal latency settings are still subject to review following recent changes to the Linux kernel. @@ -238,15 +241,20 @@ The last line is only required for Intel network cards. It seems to be ignored o Save and close geany. Reboot to restart the network. -Ping the mesa card to confirm it's all working +Ping the mesa card to confirm it's all working: + ---- ping 10.10.10.10 ---- -== Updating Linuxcnc on Debian Bookworm (X86 only) -The version of linuxcnc in Bookworm is a bit dated because of the freeze process associated with the Debian release process. Fortunately, there is a Linuxcnc buildbot which rebuilds version 2.9 packages whenever the code base changes. We can "trick" Debian to get the linuxcnc repositories from this source. These instructions assume you have already installed linuxcnc from the Debian Bookworm repositories. +== Updating LinuxCNC on Debian Bookworm (X86 only) + +The version of LinuxCNC in Bookworm is a bit dated because of the freeze process associated with the Debian release process. +Fortunately, there is a LinuxCNC buildbot which rebuilds version 2.9 packages whenever the code base changes. +We can "trick" Debian to get the LinuxCNC repositories from this source. +These instructions assume you have already installed LinuxCNC from the Debian Bookworm repositories. -Start by creating a new configuration file to set a higher priority to our linuxCNC files than the default Debian repositories. +Start by creating a new configuration file to set a higher priority to our LinuxCNC files than the default Debian repositories. ---- sudo nano /etc/apt/preferences.d/99linuxcnc-uspace ---- @@ -281,10 +289,12 @@ package: linuxcnc-uspace-doc-zh-cn pin: release o=http://buildbot2.highlab.com/debian/ Pin-Priority: 500 ---- -Hit Control-O, Y, Control-X to save the file and exit nano. Then type the following commands. -. -Before starting, you may wish to run linuxcnc from the command line and note the version number displayed as it loads. Exit the linuxcnc chooser and note the version number. +Hit Control-O, Y, Control-X to save the file and exit nano. + +Before starting, you may wish to run `linuxcnc` from the command line and note the version number displayed as it loads. +Exit the LinuxCNC chooser and note the version number. Then type the following commands: + ---- cd ~/Downloads wget http://buildbot2.highlab.com/buildbot-archive-key.gpg @@ -296,11 +306,11 @@ sudo apt upgrade The second last line updates Linux to look at our buildbot. -The last line upgrades all Linux programs including our Linuxcnc files. +The last line upgrades all Linux programs including our LinuxCNC files. -Repeat running linuxcnc and note the version. It should have changed to the latest version (which can change daily). +Repeat running LinuxCNC and note the version. It should have changed to the latest version (which can change daily). -Now any time you wish to update your version of linuxcnc (and any other Debian programs installed on your PC, just type: +Now any time you wish to update your version of LinuxCNC (and any other Debian programs installed on your PC, just type: ---- sudo apt update @@ -377,9 +387,17 @@ sudo apt purge r8168-dkms ---- == Installing a later kernel -Since the release of Debian Bullseye (Linux kernel 5.10), real time performance has been disappointing. In particular, network latency when communicating with a Mesa ethernet card has been generating Error Finishing Read Errors. This means that the network latency left insufficient time for the servo thread cycle to complete in time. -This appears to have been more prevalent with Realtek Network interfaces. Fortunately, each iteration of the Linux kernel has improved results, particularly since the release of 6.x kernels. Debian Bookworm (Debian 12) is using the 6.1 kernel which is quite good. In our testing, we found that latency improved by 265% if we used the 6.3 kernel. We have compiled this version of the kernel for your convenience. This image was updated to the final 6.3 kernel on 1 May 2023 and may be updated form time to time. +Since the release of Debian Bullseye (Linux kernel 5.10), real time performance has been disappointing. +In particular, network latency when communicating with a Mesa ethernet card has been generating Error Finishing Read Errors. +This means that the network latency left insufficient time for the servo thread cycle to complete in time. + +This appears to have been more prevalent with Realtek Network interfaces. +Fortunately, each iteration of the Linux kernel has improved results, particularly since the release of 6.x kernels. +Debian Bookworm (Debian 12) is using the 6.1 kernel which is quite good. +In our testing, we found that latency improved by 265% if we used the 6.3 kernel. +We have compiled this version of the kernel for your convenience. +This image was updated to the final 6.3 kernel on 1 May 2023 and may be updated form time to time. Only try installing it if you have exhausted all options by following the steps below: @@ -403,13 +421,15 @@ dpkg -i linux-image(tab) The easiest, preferred way to install LinuxCNC is to use the Live/Install Image or Debian Bookworm as described above. Both methods are as simple and reliable as we can make it, and are suitable for novice users and experienced users alike. -Both methods will typically replace any existing operating system on your hard drive. +Both methods will typically replace any existing operating system on your hard drive. + +Experienced users who are familiar with Debian system administration (finding install images, manipulating apt sources, changing kernel flavors, etc.) should note that new installations are supported on the platforms listed in the table below. +"amd64" refers to any 64-bit x86 system, i.e. the installation is not specific to AMD processors. -Experienced users who are familiar with Debian system administration (finding install images, manipulating apt sources, changing kernel flavors, etc), new installs are supported on following platforms: -("amd64" means "64-bit", and is not specific to AMD processors, it will run on any 64-bit x86 system) -Note that in Debian Bookworm, the preempt_rt kernel is a dependency of linuxcnc-uspace so it is automatically installed with linuxcnc so the Stock kernel is not listed. +Please be aware that in Debian Bookworm, the preempt_rt kernel is a dependency of linuxcnc-uspace. +Therefore, it is automatically installed with LinuxCNC, and the stock kernel is not listed. -If you wish to use RTAI or Xenomai, please follow the instructions in the Linuxcnc V2.8 documentation. +If you wish to use RTAI or Xenomai, please follow the instructions in the LinuxCNC V2.8 documentation. [options="header"] |=== diff --git a/docs/src/getting-started/updating-linuxcnc.adoc b/docs/src/getting-started/updating-linuxcnc.adoc index 0fa658eb382..c23a9988953 100644 --- a/docs/src/getting-started/updating-linuxcnc.adoc +++ b/docs/src/getting-started/updating-linuxcnc.adoc @@ -1062,9 +1062,9 @@ must be teleop and the corresponding command is: 'set jog x 1.234'. == Glade Virtual Control Panels In LinuxCNC 2.8 the Glade VCPs are loaded after the `POSTGUI_HALFILE` is loaded. -So connecting the pins which are created by the Glade VCP in the -`POSTGUI_HALFILE` is not possible any more in 2.8. Instead they need to be -connected in a separate HAL file passed to the gladevcp command like this: +So connecting the pins which are created by GladeVCP +in the `POSTGUI_HALFILE` is not possible any more in 2.8. +Instead, they need to be connected in a separate HAL file passed to the `gladevcp` command like this: ---- EMBED_TAB_COMMAND = gladevcp -H my_vcp_connect.hal -x {XID} my_vcp.glade diff --git a/docs/src/gui/gmoccapy.adoc b/docs/src/gui/gmoccapy.adoc index bbe97464c52..451dc11127c 100644 --- a/docs/src/gui/gmoccapy.adoc +++ b/docs/src/gui/gmoccapy.adoc @@ -1132,7 +1132,7 @@ You have three options: Nevertheless the user can change the size and position using the mouse, but that will not have any influence on the settings. * _Window decorated_ - Allows the title bar to be hidden. (default: title bar visible) * _hide cursor_ - Does allow to hide the cursor, what is very useful if you use a touch screen. -* _hide tooltips_ - Does gide the tool tips. +* _hide tooltips_ - Hides the tool tips. .Keyboard diff --git a/docs/src/gui/qtdragon.adoc b/docs/src/gui/qtdragon.adoc index b3ec988286d..18872440f57 100644 --- a/docs/src/gui/qtdragon.adoc +++ b/docs/src/gui/qtdragon.adoc @@ -257,7 +257,7 @@ You can add multiple lines for different selections in the combo box. [source,{ini}] ---- [FILTER] -PROGRAM_EXTENSION = .ngc,.nc,.tap G-Code File (*.ngc,*.nc,*.tap) +PROGRAM_EXTENSION = .ngc,.nc,.tap G-Code file (*.ngc,*.nc,*.tap) ---- QtDragon has the ability to send loaded files through a 'filter program'. @@ -440,7 +440,7 @@ These pins are specific to the QtDragon screen. + There are of course are many more HAL pins that must be connected for LinuxCNC to function. If you need a manual tool change prompt, add these lines in your postgui file. + -Qtdragon emulates the hal_manualtoolchange HAL pins - don't load the separate HAL component 'hal_manualtoolchange'. +QtDragon emulates the hal_manualtoolchange HAL pins - don't load the separate HAL component 'hal_manualtoolchange'. [source,{hal}] ---- @@ -570,7 +570,7 @@ It is up to the end user to supply the appropriate driver and HAL file connectio QtDragon can be set up to automatically raise and lower the Z axis when the spindle is paused. + When a program is paused, then you press the 'Spindle Pause' button to stop the spindle and raise it in Z. + Press the button again to start spindle and lower it, then unpause the program. + -If you have the HAL pin 'spindle.0.at-speed' connected to a driving pin, the spindle will not lower until the pin is true + +If you have the HAL pin `spindle.0.at-speed` connected to a driving pin, the spindle will not lower until the pin is true + You typically connect this to a timer or logic that detects the speed of the spindle. + If that pin is not connected to a driving pin, a dialog will pop up to warn you to wait for the spindle response. + The spindle will lower when you close that dialog. + @@ -633,7 +633,7 @@ image::images/qtdragon_hd_gcoderipper.png["QtDragon G-code Ripper"] G-code Ripper offers many functions that we will not go in to here. This is only available in the QtDragon_hd version. -* In Qtdragon_hd switch to the file tab and press the load G-code Ripper button. +* In qtdragon_hd, switch to the file tab and press the load G-code Ripper button. * Set origin to match the origin of the G-code file to be probed. * Under G-Code Operations, check Auto Probe. * File -> Open G-Code File (The file you will run after compensation) @@ -641,9 +641,9 @@ This is only available in the QtDragon_hd version. * Press Save G-Code File - Probe Only. * Save the generated file to the nc_files folder. * Exit gcode_ripper. -* There should now be a file in the nc_files folder called {something}-probe-only.ngc. Set the file filter to G-Code Files, navigate to the nc_files directory and load this file. +* There should now be a file in the nc_files folder called {something}-probe-only.ngc. Set the file filter to G-Code files, navigate to the nc_files directory and load this file. * Without changing the offsets, run this program. Make sure the probe tool is installed. When complete, there will be a file in the config directory called 'probe_points.txt'. -* In Qtdragon_hd press the 'Enable Z Comp' button to enable compensation. +* In qtdragon_hd, press the 'Enable Z Comp' button to enable compensation. Look at the status line for indication of success or failure. Active compensation will be displayed beside the label: 'Z Level Comp' While jogging that display should change based on the compensation component. @@ -781,7 +781,7 @@ You must carefully set the 'Probing Parameters': * 'Step Off': back off and re-probe distance * 'Max XY Distance': the maximum distance the probe will search for in X and Y before failing with error * 'Max Z Distance': the maximum distance the probe will search for in Z before failing with error -* 'XY Clearance': clearance distance from probe to wall edge before rapid traversing down in Z and 'rough' probng. +* 'XY Clearance': clearance distance from probe to wall edge before rapid traversing down in Z and 'rough' probing * 'Z Clearance': clearance distance from probed to top of material * 'Extra Depth': distance from top of material to desired probe depth @@ -807,31 +807,31 @@ Pressing the stop button or the keyboard escape key, will abort the probing. Lets discuss inside corner probing using the top right button in Basic Probe (back_right_inside). While all probe entries must be correct, the most important settings to change for each each probe: -* XY CLEARANCE -distance away from edge before rough probing -* Z CLEARANCE -distance from probe to top of material -* EXTRA DEPTH -distance to lower probe from top of material -* EDGE WIDTH -distance along edge wall (away from corner) to start probing. +* XY CLEARANCE - distance away from edge before rough probing, +* Z CLEARANCE - distance from probe to top of material, +* EXTRA DEPTH - distance to lower probe from top of material, +* EDGE WIDTH - distance along edge wall (away from corner) to start probing. [NOTE] -These distance are always to be set in 'machine units' (mm for metric machine, inch for imprial machine) +These distance are always to be set in 'machine units' (mm for metric machine, inch for imperial machine). Preset: * manual set probe at the intersection of the edges (ie corner) of material as described by the green bullseye on the button. Set it Z CLEARANCE above the top of material. These can be done by eye. * set EXTRA CLEARANCE to a value that you want the probe to go below the _top_ of material. (So the probe will move from its start position down Z Clearance + Extra Clearance distance.) -* set XY CLEARANCE to a value that definitely gives clearance from the wall so when the probe goes down it doesn't hit anything. +* set XY CLEARANCE to a value that definitely gives clearance from the wall so when the probe goes down it does not hit anything. * set EDGE WIDTH to a value that describes the distance measured from the corner, along the wall to where you wish to probe. this edge distance will be used along the X wall and then the Y wall. Sequence after pressing the probe button: + -. rapid EDGE WIDTH distance away from corner at the same time moving XY CLEARANCE away from edge. So this is a slightly diagonal move. -. move probe down by Z CLEARANCE + EXTRA DEPTH -. probe wall twice (rough and fine) -. move diagonally to the other wall as set by EDGE WIDTH and XY CLEARANCE -. probe wall twice -. raise probe up by Z CLEARANCE + EXTRA DEPTH 9returns to starting height) -. rapid back to starting corner, now calculated using the probed walls. +. Rapid EDGE WIDTH distance away from corner at the same time moving XY CLEARANCE away from edge. So this is a slightly diagonal move. +. Move probe down by Z CLEARANCE + EXTRA DEPTH, +. probe wall twice (rough and fine), +. move diagonally to the other wall as set by EDGE WIDTH and XY CLEARANCE, +. probe wall twice, +. raise probe up by Z CLEARANCE + EXTRA DEPTH 9returns to starting height), +. rapid back to starting corner (now calculated using the probed walls), . if auto zero button is enabled, set X and Y of the current user system to zero. == Touch plate @@ -841,7 +841,7 @@ image::images/qtdragon_touchplate.png["QtDragon Touch Plate",scale="25%"] You can use a conductive touch plate or equivalent to auto touch off (zero the user coordinate) for the Z position of a tool. There must be a tool loaded prior to probing. -In the tool tab or settings tab, set the touch plate height, search and probe velocity and Max probing distance. +In the tool tab or settings tab, set the touch plate height, search and probe velocity and max. probing distance. [NOTE] When using a conductive plate the search and probe velocity should be the same and slow. @@ -898,7 +898,7 @@ This program probes 2 user specified locations in the Z axis and calculates the This is only available in the QtDragon_hd version. .Enable Probe Position Set Buttons -* Wwhen checked, the SET buttons are enabled. +* When checked, the SET buttons are enabled. * This allows the user to automatically fill in the X, Y and Z parameters with the current position as displayed on the DROs. .Autofill Workpiece Height on Main Screen @@ -923,10 +923,10 @@ This is only available in the QtDragon_hd version. * The parameters for search velocity, probe velocity, maximum probe distance and return distance are read from the main GUI Settings page. .ABORT button -* causes all jog and probe routines currently executing to stop +* causes all jog and probe routines currently executing to stop. .HELP button -* displays this help file +* displays this help file. [NOTE] * Any 2 points within the machine operating volume can be specified. @@ -952,7 +952,7 @@ The pins are used to be read from a remap G-code subroutine, so the code can rea === Tool Measurement INI File Modifications -Modify your INI File to include the following: +Modify your INI file to include the following: ==== The PROBE section @@ -975,8 +975,8 @@ USE_PROBE = basicprobe ---- [RS274NGC] -# adjust this paths to point to folders with stdglu.py and qt_auto_tool_probe.ngc -# or similarly coded custom remap files +# Adjust this paths to point to folders with stdglu.py and qt_auto_tool_probe.ngc +# or similarly coded custom remap files. SUBROUTINE_PATH = ~/linuxcnc/nc_files/remap-subroutines:~/linuxcnc/nc_files/remap_lib # is the sub, with is called when a error during tool change happens. @@ -1358,8 +1358,8 @@ All aspects of the GUI are fully customization through Qt Designer and/or Python This capability is included with the QtVCP development environment. The extensive use of QtVCP widgets keeps the amount of required Python code to a minimum, allowing relatively easy modifications. The LinuxCNC website has extensive documentation on the installation and use of QtVCP libraries. -See <> for more information in about QtVCP in general. + -Qtdragon can also utilize QtVCP's rc file to do minor python code modifications without using a custom handler file. +See <> for more information about QtVCP in general. + +QtDragon can also utilize QtVCP's rc file to do minor python code modifications without using a custom handler file. [source,{ini}] ---- diff --git a/docs/src/gui/qtvcp-libraries.adoc b/docs/src/gui/qtvcp-libraries.adoc index 958425295dc..018338b946f 100644 --- a/docs/src/gui/qtvcp-libraries.adoc +++ b/docs/src/gui/qtvcp-libraries.adoc @@ -751,128 +751,128 @@ def on_keycall_override(self,event,state,shift,cntrl,value): Here is a list of recognized key words. Use the quoted text. + Letter keys use 'Key_' with the upper or lower letter added. + -ie. 'Key_a' and 'Key_A' +e.g., 'Key_a' and 'Key_A'. [source,python] ---- - keys = { - Qt.Key_Escape: "Key_Escape", - Qt.Key_Tab: "Key_Tab", - Qt.Key_Backtab: "Key_Backtab", - Qt.Key_Backspace: "Key_Backspace", - Qt.Key_Return: "Key_Return", - Qt.Key_Enter: "Key_Enter", - Qt.Key_Insert: "Key_Insert", - Qt.Key_Delete: "Key_Delete", - Qt.Key_Pause: "Key_Pause", - Qt.Key_Print: "Key_Print", - Qt.Key_SysReq: "Key_SysReq", - Qt.Key_Clear: "Key_Clear", - Qt.Key_Home: "Key_Home", - Qt.Key_End: "Key_End", - Qt.Key_Left: "Key_Left", - Qt.Key_Up: "Key_Up", - Qt.Key_Right: "Key_Right", - Qt.Key_Down: "Key_Down", - Qt.Key_PageUp: "Key_PageUp", - Qt.Key_PageDown: "Key_PageDown", - Qt.Key_Shift: "Key_Shift", - Qt.Key_Control: "Key_Control", - Qt.Key_Meta: "Key_Meta", - # Qt.Key_Alt: "Key_Alt", - Qt.Key_AltGr: "Key_AltGr", - Qt.Key_CapsLock: "Key_CapsLock", - Qt.Key_NumLock: "Key_NumLock", - Qt.Key_ScrollLock: "Key_ScrollLock", - Qt.Key_F1: "Key_F1", - Qt.Key_F2: "Key_F2", - Qt.Key_F3: "Key_F3", - Qt.Key_F4: "Key_F4", - Qt.Key_F5: "Key_F5", - Qt.Key_F6: "Key_F6", - Qt.Key_F7: "Key_F7", - Qt.Key_F8: "Key_F8", - Qt.Key_F9: "Key_F9", - Qt.Key_F10: "Key_F10", - Qt.Key_F11: "Key_F11", - Qt.Key_F12: "Key_F12", - Qt.Key_F13: "Key_F13", - Qt.Key_F14: "Key_F14", - Qt.Key_F15: "Key_F15", - Qt.Key_F16: "Key_F16", - Qt.Key_F17: "Key_F17", - Qt.Key_F18: "Key_F18", - Qt.Key_F19: "Key_F19", - Qt.Key_F20: "Key_F20", - Qt.Key_F21: "Key_F21", - Qt.Key_F22: "Key_F22", - Qt.Key_F23: "Key_F23", - Qt.Key_F24: "Key_F24", - Qt.Key_F25: "Key_F25", - Qt.Key_F26: "Key_F26", - Qt.Key_F27: "Key_F27", - Qt.Key_F28: "Key_F28", - Qt.Key_F29: "Key_F29", - Qt.Key_F30: "Key_F30", - Qt.Key_F31: "Key_F31", - Qt.Key_F32: "Key_F32", - Qt.Key_F33: "Key_F33", - Qt.Key_F34: "Key_F34", - Qt.Key_F35: "Key_F35", - Qt.Key_Super_L: "Key_Super_L", - Qt.Key_Super_R: "Key_Super_R", - Qt.Key_Menu: "Key_Menu", - Qt.Key_Hyper_L: "Key_HYPER_L", - Qt.Key_Hyper_R: "Key_Hyper_R", - Qt.Key_Help: "Key_Help", - Qt.Key_Direction_L: "Key_Direction_L", - Qt.Key_Direction_R: "Key_Direction_R", - Qt.Key_Space: "Key_Space", - Qt.Key_Any: "Key_Any", - Qt.Key_Exclam: "Key_Exclam", - Qt.Key_QuoteDbl: "Key_QuoteDdl", - Qt.Key_NumberSign: "Key_NumberSign", - Qt.Key_Dollar: "Key_Dollar", - Qt.Key_Percent: "Key_Percent", - Qt.Key_Ampersand: "Key_Ampersand", - Qt.Key_Apostrophe: "Key_Apostrophe", - Qt.Key_ParenLeft: "Key_ParenLeft", - Qt.Key_ParenRight: "Key_ParenRight", - Qt.Key_Asterisk: "Key_Asterisk", - Qt.Key_Plus: "Key_Plus", - Qt.Key_Comma: "Key_Comma", - Qt.Key_Minus: "Key_Minus", - Qt.Key_Period: "Key_Period", - Qt.Key_Slash: "Key_Slash", - Qt.Key_0: "Key_0", - Qt.Key_1: "Key_1", - Qt.Key_2: "Key_2", - Qt.Key_3: "Key_3", - Qt.Key_4: "Key_4", - Qt.Key_5: "Key_5", - Qt.Key_6: "Key_6", - Qt.Key_7: "Key_7", - Qt.Key_8: "Key_8", - Qt.Key_9: "Key_9", - Qt.Key_Colon: "Key_Colon", - Qt.Key_Semicolon: "Key_Semicolon", - Qt.Key_Less: "Key_Less", - Qt.Key_Equal: "Key_Equal", - Qt.Key_Greater: "Key_Greater", - Qt.Key_Question: "Key_Question", - Qt.Key_At: "Key_At", - Qt.Key_BracketLeft: "Key_BracketLeft", - Qt.Key_Backslash: "Key_Backslash", - Qt.Key_BracketRight: "Key_BracketRight", - Qt.Key_AsciiCircum: "Key_AsciiCircum", - Qt.Key_Underscore: "Key_Underscore", - Qt.Key_QuoteLeft: "Key_QuoteLeft", - Qt.Key_BraceLeft: "Key_BraceLeft", - Qt.Key_Bar: "Key_Bar", - Qt.Key_BraceRight: "Key_BraceRight", - Qt.Key_AsciiTilde: "Key_AsciiTilde", - - } +keys = { + Qt.Key_Escape: "Key_Escape", + Qt.Key_Tab: "Key_Tab", + Qt.Key_Backtab: "Key_Backtab", + Qt.Key_Backspace: "Key_Backspace", + Qt.Key_Return: "Key_Return", + Qt.Key_Enter: "Key_Enter", + Qt.Key_Insert: "Key_Insert", + Qt.Key_Delete: "Key_Delete", + Qt.Key_Pause: "Key_Pause", + Qt.Key_Print: "Key_Print", + Qt.Key_SysReq: "Key_SysReq", + Qt.Key_Clear: "Key_Clear", + Qt.Key_Home: "Key_Home", + Qt.Key_End: "Key_End", + Qt.Key_Left: "Key_Left", + Qt.Key_Up: "Key_Up", + Qt.Key_Right: "Key_Right", + Qt.Key_Down: "Key_Down", + Qt.Key_PageUp: "Key_PageUp", + Qt.Key_PageDown: "Key_PageDown", + Qt.Key_Shift: "Key_Shift", + Qt.Key_Control: "Key_Control", + Qt.Key_Meta: "Key_Meta", + # Qt.Key_Alt: "Key_Alt", + Qt.Key_AltGr: "Key_AltGr", + Qt.Key_CapsLock: "Key_CapsLock", + Qt.Key_NumLock: "Key_NumLock", + Qt.Key_ScrollLock: "Key_ScrollLock", + Qt.Key_F1: "Key_F1", + Qt.Key_F2: "Key_F2", + Qt.Key_F3: "Key_F3", + Qt.Key_F4: "Key_F4", + Qt.Key_F5: "Key_F5", + Qt.Key_F6: "Key_F6", + Qt.Key_F7: "Key_F7", + Qt.Key_F8: "Key_F8", + Qt.Key_F9: "Key_F9", + Qt.Key_F10: "Key_F10", + Qt.Key_F11: "Key_F11", + Qt.Key_F12: "Key_F12", + Qt.Key_F13: "Key_F13", + Qt.Key_F14: "Key_F14", + Qt.Key_F15: "Key_F15", + Qt.Key_F16: "Key_F16", + Qt.Key_F17: "Key_F17", + Qt.Key_F18: "Key_F18", + Qt.Key_F19: "Key_F19", + Qt.Key_F20: "Key_F20", + Qt.Key_F21: "Key_F21", + Qt.Key_F22: "Key_F22", + Qt.Key_F23: "Key_F23", + Qt.Key_F24: "Key_F24", + Qt.Key_F25: "Key_F25", + Qt.Key_F26: "Key_F26", + Qt.Key_F27: "Key_F27", + Qt.Key_F28: "Key_F28", + Qt.Key_F29: "Key_F29", + Qt.Key_F30: "Key_F30", + Qt.Key_F31: "Key_F31", + Qt.Key_F32: "Key_F32", + Qt.Key_F33: "Key_F33", + Qt.Key_F34: "Key_F34", + Qt.Key_F35: "Key_F35", + Qt.Key_Super_L: "Key_Super_L", + Qt.Key_Super_R: "Key_Super_R", + Qt.Key_Menu: "Key_Menu", + Qt.Key_Hyper_L: "Key_HYPER_L", + Qt.Key_Hyper_R: "Key_Hyper_R", + Qt.Key_Help: "Key_Help", + Qt.Key_Direction_L: "Key_Direction_L", + Qt.Key_Direction_R: "Key_Direction_R", + Qt.Key_Space: "Key_Space", + Qt.Key_Any: "Key_Any", + Qt.Key_Exclam: "Key_Exclam", + Qt.Key_QuoteDbl: "Key_QuoteDdl", + Qt.Key_NumberSign: "Key_NumberSign", + Qt.Key_Dollar: "Key_Dollar", + Qt.Key_Percent: "Key_Percent", + Qt.Key_Ampersand: "Key_Ampersand", + Qt.Key_Apostrophe: "Key_Apostrophe", + Qt.Key_ParenLeft: "Key_ParenLeft", + Qt.Key_ParenRight: "Key_ParenRight", + Qt.Key_Asterisk: "Key_Asterisk", + Qt.Key_Plus: "Key_Plus", + Qt.Key_Comma: "Key_Comma", + Qt.Key_Minus: "Key_Minus", + Qt.Key_Period: "Key_Period", + Qt.Key_Slash: "Key_Slash", + Qt.Key_0: "Key_0", + Qt.Key_1: "Key_1", + Qt.Key_2: "Key_2", + Qt.Key_3: "Key_3", + Qt.Key_4: "Key_4", + Qt.Key_5: "Key_5", + Qt.Key_6: "Key_6", + Qt.Key_7: "Key_7", + Qt.Key_8: "Key_8", + Qt.Key_9: "Key_9", + Qt.Key_Colon: "Key_Colon", + Qt.Key_Semicolon: "Key_Semicolon", + Qt.Key_Less: "Key_Less", + Qt.Key_Equal: "Key_Equal", + Qt.Key_Greater: "Key_Greater", + Qt.Key_Question: "Key_Question", + Qt.Key_At: "Key_At", + Qt.Key_BracketLeft: "Key_BracketLeft", + Qt.Key_Backslash: "Key_Backslash", + Qt.Key_BracketRight: "Key_BracketRight", + Qt.Key_AsciiCircum: "Key_AsciiCircum", + Qt.Key_Underscore: "Key_Underscore", + Qt.Key_QuoteLeft: "Key_QuoteLeft", + Qt.Key_BraceLeft: "Key_BraceLeft", + Qt.Key_Bar: "Key_Bar", + Qt.Key_BraceRight: "Key_BraceRight", + Qt.Key_AsciiTilde: "Key_AsciiTilde", + +} ---- == `Messages` diff --git a/docs/src/gui/qtvcp-vcp-panels.adoc b/docs/src/gui/qtvcp-vcp-panels.adoc index 16e693f0712..38dad77ac9f 100644 --- a/docs/src/gui/qtvcp-vcp-panels.adoc +++ b/docs/src/gui/qtvcp-vcp-panels.adoc @@ -45,7 +45,7 @@ image::images/qtvcp_spindle_belts.png["QtVCP spindle_belts Panel - Spindle Belts In addition, it is also a useful template to use for your custom panel because it includes: -* Display of additional hal data +* Display of additional HAL data * Buttons and button groups * Dynamic changes to button enabled/disabled state based on the state of other buttons * Saving data to the qtdragon.prefs file @@ -59,12 +59,16 @@ The advantage of using panels is that it separates your custom display code from * A spindle drive (for instance VFDMOD) * A custom component that scales the VFD frequency to obtain the desired spindle speed. * A belt driven spindle that uses two belts and an intermediate idler pulley much like a drill press. -* Connect the input pins qtdragon.belts. in your postgui hal file. +* Connect the input pins qtdragon.belts. in your postgui HAL file. ==== Function -The belts are broken into two button groups, the front belts and the rear belts. These are numbered as per the plate on the machine. Buttons in a group are mutually exclusive. Eg. Only one can be selected in the group. +The belts are broken into two button groups, the front belts and the rear belts. +These are numbered as per the plate on the machine. +Buttons in a group are mutually exclusive, i.e., only one can be selected in the group. -Additionally, it's not possible to have both belts on the same level with this kind of mechanism because you can’t fit two belts to the one idler pulley sheave.. So if a belt is selected, its opposite button is disabled. Eg. if belt 3 is selected, belt 7 is disabled. +Additionally, it's not possible to have both belts on the same level with this kind of mechanism because you cannot fit two belts to the one idler pulley sheave. +So if a belt is selected, its opposite button is disabled. +E.g., if belt 3 is selected, belt 7 is disabled. ==== Embedding commands Add these lines to the [DISPLAY] section in your .ini file + @@ -94,8 +98,8 @@ Customizing the panel: + * Connect the relevant pins in a postgui.hal file * Make sure your postgui file is loaded by your .ini file. -For information on the finer points, consult the qtvcp and qtdragon documentation -The python handler file also provides a useful template for any custom panel. +For information on the finer points, consult the QtVCP and QtDragon documentation. +The Python handler file also provides a useful template for any custom panel. [[sub:qtvcp:panels:test-dial]] === `test_dial` @@ -278,15 +282,15 @@ image::images/qtvismach.png["QtVCP vismach_mill_xyz - 3-Axis Mill 3D View Panel" === QtVCP `vismach_router_atc` 3D OpenGL view of a _3-Axis router style, gantry bed milling machine_. + -This particular panel shows how to define and connect the model parts in the handler file, rather then importing the -pre-built model from qtvcp's vismach library. +This particular panel shows how to define and connect the model parts in the handler file, +rather then importing the pre-built model from QtVCP's vismach library. [source,{hal}] ---- loadusr qtvcp vismach_router_atc ---- -.QtVCP `vismach_router_atc` - 3-Axis Gantry Bed Mil 3D View Panel +.QtVCP `vismach_router_atc` - 3-Axis Gantry Bed Mill 3D View Panel image::images/qtvismach_router_atc.png["QtVCP vismach_router_atc - 3-Axis Gantry Bed Mill 3D View Panel",align="center"] === QtVCP `vismach_scara` @@ -381,7 +385,7 @@ start This is to _ensure that the panel created HAL pins are actually done_ in case they are used in the rest of the file. == Embedding QtVCP Virtual Control Panels into QtVCP Screens -Qtvcp panels can be embedded into most Qtvcp screens and avoids problems such as focus transferring that can be a problem in non-native embedding. +QtVCP panels can be embedded into most QtVCP screens and avoids problems such as focus transferring that can be a problem in non-native embedding. === Embedding Commands A typical screen such as QtDragon will search the INI file under the heading [DISPLAY] for commands to embed a panel. @@ -399,11 +403,11 @@ EMBED_TAB_LOCATION=tabWidget_utilities *'EMBED_TAB_COMMAND'*:: is the command used to invoke loading of the panel. For native embedded panels the first word will always be 'qtvcp', the second will be the panel to load. You cannot currently add any switches to the command line. The panel will follow the debugging mode setting of the main screen. === Location of builtin Panels -There are panels available that are included with linuxcnc. To see a list open a terminal and type 'qtvcp' and press return. + +There are panels available that are included with LinuxCNC. To see a list open a terminal and type 'qtvcp' and press return. + You will get a help printout and a list of builtin screen and panels. + Pick any of the names from the panel list and add that to the COMMAND entry after 'qtvcp'. + The builtin panel search path is 'share/qtvcp/panels/PANELNAME'. + -Run-In-Place and installed versions of linuxcnc have these in different locations on the system. +Run-In-Place and installed versions of LinuxCNC have these in different locations on the system. === Location of Custom Panels Custom panels can be embedded too -either a modified builtin panel or a new user-built one. + @@ -416,9 +420,9 @@ In a screen handler file, the reference used for the window is 'self.w'. + In QtVCP panels, that reference will refers to the panel's window. + To reference the main window use 'self.w.MAIN' If your panel is to be able to run independently and embedded, you must trap errors from referencing objects not available. -(ie main screen objects are not available in an independent panel.) +(Note, main screen objects are not available in an independent panel.) -eg. This would use the panels preference file if there is one. +E.g., this would use the panel's preference file if there is one. [source,{hal}] ---- try: @@ -438,7 +442,7 @@ except: === Designer Widget Tips -When using python command option in Action Button widgets of an embedded panel: +When using Python command option in Action Button widgets of an embedded panel: *`INSTANCE`*:: refers to the panel window. @@ -448,7 +452,7 @@ When using python command option in Action Button widgets of an embedded panel: refers to the main screen window. E.g., `MAIN_INSTANCE.my_main_screen_handler_function_call(True)` -If the panel is not embedded, both refer to the panel window. + +If the panel is not embedded, both refer to the panel window. // vim: set syntax=asciidoc: diff --git a/docs/src/gui/qtvcp-widgets.adoc b/docs/src/gui/qtvcp-widgets.adoc index 29e0f52da9b..5064ae24d17 100644 --- a/docs/src/gui/qtvcp-widgets.adoc +++ b/docs/src/gui/qtvcp-widgets.adoc @@ -671,7 +671,7 @@ If you press and hold the button a pop up menu will show allowing one to: You must have selected an entry dialog that corresponds to the dialog_code_string, usually this is selected from the screenOptions widget. -You can select the property `halpin_option', it will then set a HAL pin true when the axis is selected. +You can select the property 'halpin_option', it will then set a HAL pin true when the axis is selected. The property 'joint_number' should be set to the appropriate joint number. The property 'axis_letter' should be set to the appropriate axis letter. diff --git a/docs/src/gui/qtvcp.adoc b/docs/src/gui/qtvcp.adoc index c85dc758500..3c232d45c1e 100644 --- a/docs/src/gui/qtvcp.adoc +++ b/docs/src/gui/qtvcp.adoc @@ -11,8 +11,7 @@ :ngc: {basebackend@docbook:'':ngc} :css: {basebackend@docbook:'':css} -QtVCP is an *infrastructure to build custom CNC screens or control -panels for LinuxCNC*. +QtVCP is an *infrastructure to build custom CNC screens or control panels for LinuxCNC*. It displays a _`.ui` file built with Qt Designer_ screen editor and combines this with _Python programming_ to create a GUI screen for @@ -49,8 +48,7 @@ image::images/test_panel.png["Test Panel",align="center"] [[sec:qtvcp-overview]] == Overview(((QtVCP Overview))) -_Two files are used, individually or in combination_, to -add customizations: +_Two files are used, individually or in combination_, to add customizations: * A *UI file* that is a _XML_ file made with _Qt Designer_ graphical editor. * A *handler file* which is a _Python_ code text file. @@ -236,10 +234,9 @@ State_LED #name_of_led{ ==== Minor Python Code Changes Another Python file can be used to *add commands* to the screen, after the handler file is parsed. -This can be useful for minor changes while still honouring standard handler updates from linuxcnc repositoies. +This can be useful for minor changes while still honouring standard handler updates from LinuxCNC repositories. In the _INI file_ under the `[DISPLAY]` heading add *`USER_COMMAND_FILE = _PATH_`* + - _PATH_ can be any valid path. It can use `~` for home directory or `WORKINGFOLDER` or `CONFIGFOLDER` to represent QtVCP's idea of those directories: @@ -263,7 +260,7 @@ These are usually seen as all capital words with no preceding self. + What can be used can vary by screen and development cycle. .A simple example -Reference the main window to change the title (Won't show if using INI entries for title change) +Reference the main window to change the title (won't show if using INI entries for title change). [source,python] ---- @@ -276,55 +273,53 @@ Here we show how to add new functions and override existing ones. [source,python] ---- -# needed to instance patch +# Needed to instance patch. # reference: https://ruivieira.dev/python-monkey-patching-for-readability.html import types -# import the handlerfile to get reference to it's libraries +# import the handlerfile to get reference to it's libraries. # use _handler import qtdragon_handler as hdlr # This is actually an unbounded function with 'obj' as a parameter. # You call this function without the usual preceding 'self.' # This is because will will not be patching it into the original handler class instance -# It will only be called from code in this file +# It will only be called from code in this file. def test_function(obj): print(dir(obj)) # This is a new function we will added to the existing handler class instance. -# Notice it calls the unbounded function with 'self' as an parameter -# 'self' is the only global reference available. It references the window instance +# Notice it calls the unbounded function with 'self' as an parameter 'self' is the only global reference available. +# It references the window instance. def on_keycall_F10(self,event,state,shift,cntrl): if state: print ('F10') test_function(self) -# This will be used to override an existing function in the existing handler class instance -# note we also call a copy of the original function too -# this shows how to extend an existing function to do extra functions +# This will be used to override an existing function in the existing handler class instance. +# Note, we also call a copy of the original function too. +# This shows how to extend an existing function to do extra functions. def on_keycall_F11(self,event,state,shift,cntrl): if state: self.on_keycall_F11_super(event,state,shift,cntrl) print ('Hello') -# We are referencing the KEYBIND library that was instantiated in the -# original handler class instance by adding 'hdlr.' to it (from the imp). -# This function tells KEYBIND to call 'on_keycall_F10' when F10 is pressed +# We are referencing the KEYBIND library that was instantiated in the original handler class instance +# by adding 'hdlr.' to it (from the imp). +# This function tells KEYBIND to call 'on_keycall_F10' when F10 is pressed. hdlr.KEYBIND.add_call('Key_F10','on_keycall_F10') -# Here we are instance patching the original handler file to add a new -# function that calls our new function (of the same name) -# defined in this file +# Here we are instance patching the original handler file to add a new function +# that calls our new function (of the same name) defined in this file. self.on_keycall_F10 = types.MethodType(on_keycall_F10, self) -# Here we are defining a copy of the original 'on_keycall_F11' function -# so we can call it later. we can use any valid, unused function name. +# Here we are defining a copy of the original 'on_keycall_F11' function, +# so we can call it later. We can use any valid, unused function name. # We need to do this before overriding the original function. self.on_keycall_F11_super = self.on_keycall_F11 -# Here we are instance patching the original handler file to override -# an existing function to point to our new function (of the same name) -# defined in this file +# Here we are instance patching the original handler file to override an existing function +# to point to our new function (of the same name) defined in this file. self.on_keycall_F11 = types.MethodType(on_keycall_F11, self) ---- diff --git a/docs/src/hal/intro.adoc b/docs/src/hal/intro.adoc index 87dd6d03ee1..8640d0a5c84 100644 --- a/docs/src/hal/intro.adoc +++ b/docs/src/hal/intro.adoc @@ -28,7 +28,7 @@ The Hardware Abstraction Layer (or with a reference to the link:https://en.wikip * optionally process and/or override that information as it flows from component to component. In itself, this link:https://en.wikipedia.org/wiki/Middleware[Middleware] is agnostic about its application on CNC. -An Internet search, for example, found an astronomical application to control telescopes using Linuxcnc. +An Internet search, for example, found an astronomical application to control telescopes using LinuxCNC. Motors move the telescope into the right position, and it needs to know how to map motor activity with the effect of that positioning with the real world. Such a synchronisation of motor positions with real-world positions is reminiscent of what CNC machines need to do, or space craft. @@ -79,7 +79,7 @@ But multiple interfaces have been provided that allow HAL to be manipulated but none of these interfaces are 'HAL itself'. HAL itself is not a program, it consists of one or more lists of loaded programs (the components) that are periodically executed (in strict sequence), and an area of shared-memory that these components use to interchange data. -The main HAL script runs only once at machine startup, setting up the realtime threads and the shared-memory locations, loading the components and setting up the data links between them (the "signals" and "pins") +The main HAL script runs only once at machine startup, setting up the realtime threads and the shared-memory locations, loading the components and setting up the data links between them (the "signals" and "pins"). In principle multiple machines could share a common HAL to allow them to inter-operate, however the current implementation of LinuxCNC is limited to a single interpreter and a single Task module. Currently this is almost always a G-code interpreter and "milltask" (which was found to also work well for lathes and adequately for robots) but these modules are selectable at load-time. @@ -142,7 +142,7 @@ On a higher level, some components know how the machine's axes are arranged in 3 Lathes, mills and robots will differ in the LinuxCNC component that are active, i.e. that are loaded by a HAL configuration file for that machine. Still, two machines may be looking very different since built for very different purposes, but when they both use servo motors then they can still both use the same HAL servo component. -.From Where the Incentive to Move Originates +.Origin of the Incentive to Move On the lowest (closest to hardware) level, e.g. for stepper motors, the description of a state of that motor is very intuitive: It is the number of steps in a particular direction. A difference between the desired position and the actual position translates into a movement. diff --git a/docs/src/ladder/classic-ladder.adoc b/docs/src/ladder/classic-ladder.adoc index 93cd6623b12..a3041c8d61d 100644 --- a/docs/src/ladder/classic-ladder.adoc +++ b/docs/src/ladder/classic-ladder.adoc @@ -291,9 +291,9 @@ A short description of each of the buttons: * 'Timer' - creates a Timer Module (depreciated use IEC Timer instead). * 'Monostable' - creates a one-shot monostable module * 'Counter' - creates a counter module. -* 'Compare' - creates a compare block to compare variable to values or other variables, e.g. %W1<=5 or %W1=%W2. +* 'Compare' - creates a compare block to compare variable to values or other variables, e.g. `%W1<=5` or `%W1=%W2`. Compare cannot be placed in the right most side of the section display. -* 'Variable Assignment' - creates an assignment block so you to assign values to variables, e.g. %W2=7 or %W1=%W2. +* 'Variable Assignment' - creates an assignment block so you to assign values to variables, e.g. `%W2=7` or `%W1=%W2`. ASSIGNMENT functions can only be placed at the right most side of the section display. === Config Window @@ -310,7 +310,7 @@ image::images/Config.png["Config Window",align="center"] Represent switches or relay contacts. They are controlled by the variable letter and number assigned to them. -The variable letter can be B, I, or Q and the number can be up to a three digit number, e.g. %I2, %Q3, or %B123. +The variable letter can be B, I, or Q and the number can be up to a three digit number, e.g. `%I2`, `%Q3`, or `%B123`. Variable I is controlled by a HAL input pin with a corresponding number. Variable B is for internal contacts, controlled by a B coil with a corresponding number. Variable Q is controlled by a Q coil with a corresponding number (like a relay with multiple contacts). @@ -341,7 +341,7 @@ There are three modes - TON, TOF, TP. * 'TOF' - When timer input is true, sets output true. When the input is false the timer counts down then sets output false. * 'TP' - When timer input is pulsed true or held true timer sets output true till timer counts down. (one-shot) -The time intervals can be set in multiples of 100ms, seconds, or minutes. +The time intervals can be set in multiples of 100&8239;ms, seconds, or minutes. There are also Variables for IEC timers that can be read and/or written to in compare or operate blocks. @@ -409,11 +409,11 @@ The range is 0 to 9999. There are also Variables for counters that can be read and/or written to in compare or operate blocks. -* '%Cxx.D' - Counter xx done (Boolean, read only) -* '%Cxx.E' - Counter xx empty overflow (Boolean, read only) -* '%Cxx.F' - Counter xx full overflow (Boolean, read only) -* '%Cxx.V' - Counter xx current value (integer, read or write) -* '%Cxx.P' - Counter xx preset (integer, read or write) +* '%C'__xx__`.D` - Counter _xx_ done (_Boolean_, _read only_) +* '%C'__xx__`.E` - Counter _xx_ empty overflow (_Boolean_, _read only__) +* '%C'__xx__`.F` - Counter _xx_ full overflow (_Boolean_, _read only_) +* '%C'__xx__`.V` - Counter _xx_ current value (_integer_, _read_ or _write_) +* '%C'__xx__`.P` - Counter _xx_ preset (_integer_, _read_ or _write_) === COMPARE @@ -421,20 +421,20 @@ For arithmetic comparison. Is variable %XXX = to this number (or evaluated numbe The compare block will be true when comparison is true. You can use most math symbols: -* +, -, *, /, = (standard math symbols) -* < (less than), > (greater than), <= (less or equal), >= (greater or equal), <> (not equal) -* (, ) separate into groups example %IF1=2,&%IF2<5 in pseudo code translates to if %IF1 is equal to 2 and %IF2 is less than 5 then the comparison is true. +* `+`, `-`, `*`, `/`, `=` (standard math symbols) +* `<` (less than), `>` (greater than), `<=` (less or equal), `>=` (greater or equal), `<>` (not equal) +* `(`, `)` separate into groups example `%IF1=2,&%IF2<5` in pseudo code translates to if %IF1 is equal to 2 and %IF2 is less than 5 then the comparison is true. Note the comma separating the two groups of comparisons. -* ^ (exponent),% (modulus),& (and),| (or),. - -* ABS (absolute), MOY (French for average), AVG (average) +* `^` (exponent), `%` (modulus), `&` (and), `|` (or),. - +* `ABS` (absolute), `MOY` (French for average), `AVG` (average) For example ABS(%W2)=1, MOY(%W1,%W2)<3. No spaces are allowed in the comparison equation. -For example %C0.V>%C0.P is a valid comparison expression while %C0.V > %CO.P is not a valid expression. +For example `%C0.V>%C0.P` is a valid comparison expression while `%C0.V > %CO.P` is not a valid expression. There is a list of Variables down the page that can be used for reading from and writing to ladder objects. -When a new compare block is opened be sure and delete the # symbol when you enter a compare. +When a new compare block is opened be sure and delete the `#` symbol when you enter a compare. To find out if word variable #1 is less than 2 times the current value of counter #0 the syntax would be: @@ -455,7 +455,7 @@ Note: Compare uses the arithmetic equals not the double equals that programmers For variable assignment, e.g. assign this number (or evaluated number) to this variable %xxx, there are two math functions MINI and MAXI that check a variable for maximum (0x80000000) and minimum values (0x07FFFFFFF) (think signed values) and keeps them from going beyond. -When a new variable assignment block is opened be sure to delete the # symbol when you enter an assignment. +When a new variable assignment block is opened be sure to delete the `#` symbol when you enter an assignment. To assign a value of 10 to the timer preset of IEC Timer 0 the syntax would be: @@ -545,35 +545,35 @@ These Variables are used in COMPARE or OPERATE to get information about, or chan List of variables : -* '%Bxxx' - Bit memory xxx (Boolean) -* '%Wxxx' - Word memory xxx (32 bits signed integer) -* '%IWxxx' - Word memory xxx (S32 in pin) -* '%QWxxx' - Word memory xxx (S32 out pin) -* '%IFxx' - Word memory xx (Float in pin) (*converted to S32 in ClassicLadder*) -* '%QFxx' - Word memory xx (Float out pin) (*converted to S32 in ClassicLadder*) -* '%Txx.R' - Timer xx running (Boolean, user read only) -* '%Txx.D' - Timer xx done (Boolean, user read only) -* '%Txx.V' - Timer xx current value (integer, user read only) -* '%Txx.P' - Timer xx preset (integer) -* '%TMxxx.Q' - Timer xxx done (Boolean, read write) -* '%TMxxx.P' - Timer xxx preset (integer, read write) -* '%TMxxx.V' - Timer xxx value (integer, read write) -* '%Mxx.R' - Monostable xx running (Boolean) -* '%Mxx.V' - Monostable xx current value (integer, user read only) -* '%Mxx.P' - Monostable xx preset (integer) -* '%Cxx.D' - Counter xx done (Boolean, user read only) -* '%Cxx.E' - Counter xx empty overflow (Boolean, user read only) -* '%Cxx.F' - Counter xx full overflow (Boolean, user read only) -* '%Cxx.V' - Counter xx current value (integer) -* '%Cxx.P' - Counter xx preset (integer) -* '%Ixxx' - Physical input xxx (Boolean) (HAL input bit) -* '%Qxxx' - Physical output xxx (Boolean) (HAL output bit) -* '%Xxxx' - Activity of step xxx (sequential language) -* '%Xxxx.V' - Time of activity in seconds of step xxx (sequential language) -* '%Exx' - Errors (Boolean, read write(will be overwritten)) +* `%B`__xxx__ - Bit memory _xxx_ (Boolean) +* `%W`__xxx__ - Word memory _xxx_ (32 bits signed integer) +* `%IW`__xxx__ - Word memory _xxx_ (S32 in pin) +* `%QW`__xxx__ - Word memory _xxx_ (S32 out pin) +* `%IF`__xx__ - Word memory _xx_ (Float in pin) (*converted to S32 in ClassicLadder*) +* `%QF`__xx__ - Word memory _xx_ (Float out pin) (*converted to S32 in ClassicLadder*) +* `%T`__xx__`.R` - Timer _xx_ running (Boolean, user read only) +* `%T`__xx__`.D` - Timer _xx_ done (Boolean, user read only) +* `%T`__xx__`.V` - Timer _xx_ current value (integer, user read only) +* `%T`__xx__`.P` - Timer _xx_ preset (integer) +* `%TM`__xxx__`.Q` - Timer _xxx_ done (Boolean, read write) +* `%TM`__xxx__`.P` - Timer _xxx_ preset (integer, read write) +* `%TM`__xxx__`.V` - Timer _xxx_ value (integer, read write) +* `%M`__xx__`.R` - Monostable _xx_ running (Boolean) +* `%M`__xx__`.V` - Monostable _xx_ current value (integer, user read only) +* `%M`__xx__`.P` - Monostable _xx_ preset (integer) +* `%C`__xx__`.D` - Counter _xx_ done (Boolean, user read only) +* `%C`__xx__`.E` - Counter _xx_ empty overflow (Boolean, user read only) +* `%C`__xx__`.F` - Counter _xx_ full overflow (Boolean, user read only) +* `%C`__xx__`.V` - Counter _xx_ current value (integer) +* `%C`__xx__`.P` - Counter _xx_ preset (integer) +* `%I`__xxx__ - Physical input _xxx_ (Boolean) (HAL input bit) +* `%Q`__xxx__ - Physical output _xxx_ (Boolean) (HAL output bit) +* `%X`__xxx__ - Activity of step _xxx_ (sequential language) +* `%X`__xxx__`.V` - Time of activity in seconds of step _xxx_ (sequential language) +* `%E`__xx__ - Errors (Boolean, read write(will be overwritten)) * 'Indexed or vectored variables' - These are variables indexed by another variable. Some might call this vectored variables. - Example: %W0[%W4] => if %W4 equals 23 it corresponds to %W23 + Example: `%W0[%W4]` => if %W4 equals 23 it corresponds to %W23 == GRAFCET (State Machine) Programming @@ -620,8 +620,8 @@ To use links, you must have steps already placed. Select the type of link, then select the two steps or transactions one at a time. It takes practice! -With sequential programming: The variable %Xxxx (e.g., %X5) is used to see if a step is active. -The variable %Xxxx.V (eg. %X5.V) is used to see how long the step has been active. +With sequential programming: The variable `%X`__xxx__ (e.g., `%X5`) is used to see if a step is active. +The variable `%X`__xxx__`.V` (e.g., `%X5.V`) is used to see how long the step has been active. The %X and %X.v variables are use in LADDER logic. The variables assigned to the transitions (e.g., %B) control whether the logic will pass to the next step. After a step has become active the transition variable that caused it to become active has no control of it anymore. The last step has to JUMP LINK back only to the beginning step. diff --git a/docs/src/user/user-intro.adoc b/docs/src/user/user-intro.adoc index 78bf1255fda..c6534c72a19 100644 --- a/docs/src/user/user-intro.adoc +++ b/docs/src/user/user-intro.adoc @@ -147,7 +147,7 @@ They are very similar in features but QtDragon_hd is made for larger monitors. image::images/qtdragon.png["QtDragon, a touch screen GUI based on QtVCP",align="center"] == User Interfaces -These User interfaces are a way to interact with linuxcnc outside of the graphical user interfaces. +These User interfaces are a way to interact with LinuxCNC outside of the graphical user interfaces. halui:: A HAL based user interface allowing to control LinuxCNC using buttons and switches