:: Links to examples of projects that explain KMotionCNC customizations
::: Troy (tmday7) created some helpful documents listed on the Yahoo Group Files Section [https://groups.yahoo.com/neo/groups/DynoMotion/files/KmotionCNC%20Screen%20Customizing/ here].
===[[KMotionCNC Screen Editor]]===
'''Table of contents:'''
# Introduction
* Customizable Button Tool Tips
* Programmable DRO (Digital Read Output) Labels
* Custom User Entry Controls The 6-axes default screen is changed to a 5-axes screen by deleting the z-axis. We start by installing KMotion 4.34b or later. Note that if you don’t already have Dot Net version 4.62 or Visual Studio 2015 libraries installed, you will be prompted to load those. Create desktop icons for KMotion, KMotionCNC and KMotionCNC Screen Editor. Run KMotion and observe the default 3-axes resizable screen. [[File:3axes-resizable-screen.png|none|link=|504x286px]] Close the G Viewer window and change the dialog face to Default Custom Screen with no screen script specified. (Tool Setup): [[File:Default-custom-screen.png|none|link=]] Now run the KMotionCNC Screen Editor. It automatically syncs to KMotionCNC’s controls and they are graphically displayed. This graphical representation allows you to select which controls you want to modify. Notice we can select a control and immediately hide or show it over at KMotionCNC. The controls can be moved or resized. There is also unlimited undo/redo. Multiple controls can be selected by dragging the mouse over the graphical display. Click SHIFT to add more controls, or CTRL to remove from the selection. '''Examples: ''' * Select multiple controls for hiding and moving.* Change main dialog screen dimensions.* Change label text. Push SET key and KMotion CNC screen updates the text.* Increase the size of the controls. The screen editor features international text support. Note that only certain fonts are capable of displaying international text. In our example, we selected Arial. Labels can show or toggle bitmaps based on an IO bit. As an example, we first we select bitmap 1, then bitmap 2. Increase the size of the label, so the bitmap shows properly. Then assign an IO bit number that will control the bitmap displayed. Notice the bitmap turns green, because the bit is currently on. Open KMotion and look at the state of IO bit #46 and see that it is on. Toggling the bit affects the bitmap on the screen: [[File:Toggle-IO-bit.png|none|link=]] Users can configure push buttons for text, font, size, color, and tool tip. Select two sample labels and change them to type: button. Select both buttons and modify their fonts as well as their size. Four colors are available for text and background, each in normal and depressed button state. You can then change the name of each button individually, one to say “On” and the other“Off”. You can assign tool tips to each of the buttons, so when the operator hovers over the buttons, they will be prompted with a tool tip notification. Buttons can be assigned to perform actions. Select a script that can either be a screen script or an action. We select an action type to set bit 46 to 1. Notice that this is the script that indicated that. For the other button, we select an action which sets bit 46 to 0. Now pushing the buttons will perform these actions. Save your new screen as a screen script file. Screen script is under the KMotionCNC directory and the sub-directory“Screens”. Configure KMotionCNC to use this new screen at every new startup.Notice that tool setup screen can be accessed by right-mouse clicking on the KMotionCNC title (in “Tools/Setup files”). Select the screen you just created. Some more advanced features include input fields, C program actions, label DROs. Load the addition example in the screen editor. Example contains two user input controls and one DRO label control. The input edit controls are associated with KFLOP persist variables 160 and 161. The DRO label is associated with KFLOP persist variable 162. The Add button is configured for screen script action to run a C program in KFLOP. The C program is contained in the file “Add.c”. Test it by entering two values and pushing the Add button. Now open KMotion and look at the simple C code that is behind the function. (Open the file “Add.c”). '''Momentary and Toggle button types in KMotion CNC Screen Editor''' [https://www.youtube.com/watch?v=eE2mSUXxN2M https://www.youtube.com/watch?v=eE2mSUXxN2M] Start KMotion CNC Screen Editor, and click on the “Main” tab, then on “Read Script” and choose the file named MomentaryToggle.scr You will see two buttons, a Momentary button assigned to bit46 and a Toggle button assigned to bit 47. You will also see two labels to display the status of bits 46 and 47 as LED bitmaps. We also have KMotion displaying the status of bits 46 and 47. [[File:Momentary-button-2.png|none|link=]] Clicking the Momentary button activates the bit; releasing it,deactivates it. Clicking the Toggle button once sets the bit; clicking it again releases it. '''Instantaneous Feed Rate Display''' [https://youtu.be/w-bKvqXCd0Q https://youtu.be/w-bKvqXCd0Q] Normally the feed rate indication in KMotionCNC shows ''average'' feed rate over 100ms, assuming straight line motion. Here we use a C program to calculate a more instantaneous rate and display it on the KMotionCNC screen using the KMotionCNC screen editor. Here the C program samples two positions and times, computes the delta position and the delta time, formats it to a string and displays it onto DRO label 162 in KMotionCNC and it performs this action roughly every one ½ seconds. Here is the screen script for the screen shown on the left, we’ve added a type DRO label in the screen editor, edited colors and it is connected to persist variable 162. This job consist of a rapid heal explore (?) at a rate of about 6 revolutions per second. It shows the instant feed rate being more correct. '''Split/Full/Hidden GViewer Display on Main Dialog Face''' [https://youtu.be/VkBhYpyGpNU https://youtu.be/VkBhYpyGpNU] KMotionCNC Screen Editor supports changing main screen style. New Boolean Screen Script “Main:” Options: "Caption:" "MaxBox:" "MinBox:" "ResizeFrame:" "Maximize:" '''Maximized Captionless KMotionCNC Screens''' [https://youtu.be/R44F0_upIoA https://youtu.be/R44F0_upIoA] New option in KMotionCNC Screen Editor V4.34e allows screens to be maximized to full screen and with or without Window Frame/Title. New options in Screen Editor: turn minimum box on or off, maximum box on or off, resizing frame on or off. Caption on top can be present or absent. Available viewing options (three buttons on the top-right hand side of the screen: “Split”: Split screen mode, “View”: G Code Viewer or “Code”: G Code. # ''' Control styles''' '''<br />'''Available style options:<br />[[File:Style-options.png|none|link=]]
===PC Example Applications===