Cover image of How to use G-Code UI on ctrlX CORE

How to use G-Code UI on ctrlX CORE

ZYL_02
Member
Introduction

This documentation describes how to install and use ctrlX G-Code UI. G-Code UI was developed with Node-RED and PLC Engineering. It consists of a PLC project package and Node-RED template which can be customized.

G-Code UI functionality

G-Code UI supports the following features:

  • Editor to create / write / delete a NC program.
  • NC program selection.
  • Start, stop, reset, and pause the NC program kinematics, respectively.
  • Control path velocity by feed rate override.
  • Different coordinate systems like ACS and PCS.
  • Observe position and state of kinematics.
  • System diagnostics.
Installation and activation of G-Code UI

A licensed installation of following apps (V2.4.x or above) is expected before activating G-Code UI.

Mandatory:

Note: Please install G-Code Runtime App after MOTION App!

Optional:


The G-Code UI template includes two parts:

  • PLC package: Bosch Rexroth AG GCode ****.package
  • Node-RED template flows: GCode_UI_****.json (or GCode_UI_*.*.*.*.zip)

Both should be installed to activate and operate the UI. 

PLC Part

Install the G-Code template package to the ctrlX PLC Engineering, only need to install for the first time:

How to install PLC template package of G-Code UIHow to install PLC template package of G-Code UI

Create a new PLC project and insert PLC templates. Both the G-Code template and Motion Interface template need to be inserted:

Insert the PLC templates in PLC projectInsert the PLC templates in PLC project

Select and insert G-Code templateSelect and insert G-Code templateSelect and insert Motion Interface templateSelect and insert Motion Interface template
Make sure the right PLC project is loaded, and "Application" of PLC runtime in ctrlX WORKS is in state of "RUN".     
Application of PLC runtime in ctrlX WORKS is in state of RUNApplication of PLC runtime in ctrlX WORKS is in state of RUN
All of PLC interface variables can be traced in the DataLayer node, as shown in the figure below.
(Path: plc/app/Application/sym/GVL_UI_PLC/stInputData)PLC interface variables in the DataLayer nodePLC interface variables in the DataLayer node

Node-RED part
There are two methods to load and active Node-RED configuration:

  • Load GCode_UI_****.zip from the "Manage app data".
  • Or import GCode_UI_****. json in Node-RED flow editor.

Note: 

Spoiler
GCode_UI_**** .zip : It doesn't only contain the configuration of Node-RED, but also the configuration of Motion, the existing motion configuration will be overwritten. Therefore, it is recommended to load and activate the Node-RED configuration through the second way.
GCode_UI_****. json:  It only contains the configuration of Node-RED, the user needs to add axes and create at least one kinematics before implementation.
Method 1: Activate the configuration of Node-RED by loading the GCode_UI_****.zip file.
  • Switch ctrlX CORE state to "Setup" mode, uploads GCode_UI_****.zip file via "Home → Manage app data → Archive/Uploads Configuration".
  • Active the configuration and switch the ctrlX CORE state to "Operating" mode.
Activate the configuration of Node-RED by loading the GCode_UI_****.zip fileActivate the configuration of Node-RED by loading the GCode_UI_****.zip file
Method 2: Activate the configuration of Node-RED by import the GCode_UI_****. json file.                 
Open Flow Editor of Node-RED App, then import the Node-RED configuration flows.

Activate the configuration of Node-RED by import the GCode_UI_****. jsonxfileActivate the configuration of Node-RED by import the GCode_UI_****. jsonxfile
Note:   
Spoiler
The Node-RED configuration has been uploaded, but there are two ctrlX Automation nodes that need to be logged in before flows are deployed. One is the “Data Layer Request” node and another one is “Data Layer Subscribe" node. 
xData Layer Requestxx nodexData Layer Requestxx nodexData Layer Subscribe" nodexData Layer Subscribe" node

How to log in “Data Layer Request” node
  • Double-click any “Data Layer Request” node to open the configuration window.
  • Enter the user name and password to log in, as shown in the figure below.
  • Deploy the flows.
Same for the "Data Layer Subscription" node.
How to log in Data Layer request nodeHow to log in Data Layer request node
Description of G-Code UI 

The page HMI-Operating includes five areas: kinematics select, program, machine status, operation and diagnosis.

HMI-Operating of G-Code UIHMI-Operating of G-Code UI 

kinematics select area:

Before using this UI, at least one kinematics should be created, then the created kinematics can be read and selected.

kinematics select kinematics select

For 2.6.0 and below, before active operating mode, need refresh and select the kinematics in the configuration mode page, show as below picture. 

HMI-Configuration of G-Code UI (2.6.0 and below)HMI-Configuration of G-Code UI (2.6.0 and below)

Programming area:

There are two pages in the program area. The default page "NC_Program" displays the operable fields for of the program, which are described in the table 1. The "Active_NC_Blocks" page displays the activated NC block. The page is switched from "NC_Program" to "Active_NC_Blocks" automatically when the NC program is running.

Table 1: optional operations of program area of HMI-Operating 
  Name Description
1 Path Show the file path of program.
2 PARENT DIR Return to the parent directory.
3 REFRESH Refresh the program list.
4 CREATE FILE

Create program. For 2.6.0 and below, need input the file name of new  program via "Filename to be created", and then click "CREATE" to complete the creation of the program.

5 DELETE FILE Delete program.
6 CREATE DIR

Create customer directors in path "Manage app data/Active/scripts".

7 ACTIVE BLOCKS Switch page to "Active_NC_Blocks" manually via "ACTIVE BLOCKS". Only when NC program is running, the "ACTIVE_NC_ BLOCKS" page can display the executing NC blocks. Switch from "Active_NC_Blocks" page to "NC_Program" page via "PROGRAM" button.
8 SAVE Save the NC program.

 

Machine status area:

  • Display axis status, position, and velocity information. Maximal seven axes status can be displayed.
  • Slider of override to modify the percentage of command value F.
  • Observe the active command options.
  • Show kinematics activated name and state.
  • Displays pre-selected and loaded programs.

Operating area:

This area provides operation buttons to control the system.
Table 2: optional operations of operating area of HMI-Operating 
  Name Description
1 KIN ON Axes power on and group enable. 
2 KIN OFF Axes power off and group disable.
3 PROG LOAD Load the pre-selected program, switch UI state from "DISABLED" to "READY".
4 START
  • Start NC program, switch UI state from "READY" to "RUNNING".
  • Continue running NC program which has been interrupted by pause. UI state switch from "PAUSE" to "RUNNING".
  • Reset M0 and continue running NC program. 
5 STOP Stop NC program, switch UI state from "RUNNING" /"PAUSE" to "READY".
6 PAUSE Pause NC program, switch UI state from "RUNNING" to "PAUSE".
7 RESET Reset errors, switch UI state from "ERROR" to "DISABLED".
8 PCS Show kinematics position in product coordinate system.

Diagnosis display

When an error occurs, the user can get the following information from the UI:

  • Main diagnosis: Main number of the diagnostic information.
  • Detail diagnosis: Detailed number of the diagnostic information.
  • Error Information: Description of error.
  • Error source: Traced source of the error

The diagnosis includes motion error, G-Code error, PLC error and error from others.  If the error cannot reset from UI, users can clear pending alarm as below picture. 

Clearxpending alarmsClearxpending alarms

All errors also can be traced in Diagnostics/Logbook, and in addition, the errors from G-Code and motion can also be traced in data layer node.

G-Code error:  script/instances/<"kinematics name">/diag

The DataLayer node for G-Code errorThe DataLayer node for G-Code error

 Motion error: motion/kin/Kinematics_1/state/diag-info

The DataLayer node for Motion errorsThe DataLayer node for Motion errors

 Note: 

Spoiler
Big NC file can be loaded in "Manage app data -> Active -> Scripts will be executed by script runner", it should be edited before loading.

Operate G-Code UI 

Before you operate G-Code UI, at least one kinematics should be created and PLC project should be in “RUN” state.

  • Open G-Code UI at the Node-RED/ Dashboard. 
  • Select one kinematics.
  • Axes power on and group axes of kinematics via "KINON" button.
  • Create a new program via "CREATE FILE".  The NC programs are saved in  "Manage app data-> Active->Scripts will be executed by script runner->gcode". 
  • Select and open the new program, then NC program can be edited.
  • Save the NC program via "SAVE" button.
  • Click the "PROG LOAD" button to load the pre-selected program.
  • Click the "START" button to implement the program which loaded.
  • Pause NC program via "PAUSE", and then continue running program via "START". 
  • Stop NC program via "STOP" and reset error via "RESET".
Related Links
19 Comments
Usalas
Long-established Member

Loaded and runs fine. However i found a few errors that showed up when following the steps.

when downloading the PLC program there was an error, apparently there was a task not in used. so i deleted that task. I think it was related to the oscilloscope.

Node Red 2.4 : subscription nodes gives a constant error disconnecting the node. Installed Nodered 2.2 and works well. 

ZYL_02
Member

Hi @Usalas

Thank you for you feedback.

Below picture is shown a workaround for the error of subscription nodes for Node Red 2.4

Users can manually enter recommended values.

Node-RED error solution for 2.4.0.0Node-RED error solution for 2.4.0.0

 

tszalkai
Member

Is there a way to pass PLC tags to X, Y, Z positions? Like in this example of G01 X50 Y50 Z-10 , I could use something like this: G01 X%PLC_Tag_X% Y50 Z-10 where X position is defined by PLC_Tag_X. This would be very important if some of the X Y Z points need to be calculated based on parameters entered by the user.

EduardX
Member

Hello. In actual version we don't support positioning of NC axes by commanding the position value via a variable. But the NC functionality is gradually being expanded. This feature is planned for the future.

JordiLaboria
Established Member

Good Morning,

Is it possible to have a download link for the version of the PLC package file for version 1.20?, am I only finding versions 2.4 and 2.6

EduardX
Member

Hello JordiLaboria

the G-Code Runtime APP is being continuously developed. The package is currently available for version ctrlX WORKS 2.6. We strongly recommend to use the latest version, as the functionality of the older versions is insufficient for real applications.

Best regards, Eduard

JordiLaboria
Established Member

Ok. Thank you very much for the reply.

Best Regards

 

 

JordiLaboria
Established Member

Good morning, I suppose you already know but there is an error in one of the internal structures, MC_AXIS_PLC_OPEN_STATE, whose data must be modified by hand in the program.

JordiLaboria_0-1712834274442.png

JordiLaboria_1-1712834338327.png

Best Regards

 

 

 

ZYL_02
Member

Hello JordiLaboria

Thanks for your information.

This issue had modify in the version 2.6 of the PLC package (with the default CXA_PLCopen 2.6.0.0 or higher).

lib version lower CXA_PLCopen 2.6.0.0: DISABLEED

=>

lib version is CXA_PLCopen 2.6.0.0 or higher: DISABLED

 

1-2-3-KID
New Poster

Hi! At the beginning in PLC Part it was not possible to create a PLC Template while the error message occured "im package wurde keine Signatur gefunden". I did the steps as men

tioned.

Any suggestions?

SteS
Member

Hello 1-2-3 KID,

here a picture from my Gcode Workshop. You must mark the Field"I want to continue despite the missing signature". See end of the pictureSteS_0-1723099764823.png

 

 

Naz
New Poster

Hello, 

I would like to know how easy it is to modify the Node-Red and PLC code. For example, adding a manual (Jog axis) or auto mode, etc. Additionally, is there a guide that explains the PLC code?

Thanks 

Felix_
Established Member

Hello,

We got the following Error 

Felix__0-1727182666521.png

According to the documentation it means :"script instance already exist with different language type"

Felix__1-1727182761117.png

 

Kinematics_1 has been well configured in the Motion App.

Felix__2-1727182834961.png

So does someone know why we get this error?

Many thanks.

 

ZYL_02
Member

Hello @Naz

 For the G-code UI, its default mode is automatic, if need add manual (Jog axis) mode, you can take MotionInterface UI as an example.

There are no detail description for the PLC code. All the interface during PLC and Node-RED UI are config as gloabal variables in GVL_UI_PLC, show as below picture. 

ZYL_02_0-1727230827071.png

 

ZYL_02
Member

Hello @Felix_ 

Begain CXA_ScriptInterpreter3.3.0.0 or 2.6.2.0 and above version, a new interface variable "Language" has added for the function block IL_ScriptInstance, it both supports gcode and python language, and its default languge is python. So from CXA_ScriptInterpreter3.3.0.0 or 2.6.2.0 and above version, need selecte a languge and input it. example:

ZYL_02_0-1727233686917.png

 

 

Nathanael
Established Member

Hello @ZYL_02 ,

I'm a colleague of and I 've followed your hint like this:

Nathanael_0-1727256762334.png

So now, I can run my kinematics.

Thanks 😉

Naz
New Poster

Hi @ZYL_02

There is already a visualization for jogging the axis in the MotionInterface folder. I’m just wondering if this UI-Gcode has been used on an actual working machine (Customer Machine). I’m asking because I presented it to a customer, and they found it too simple compared to more advanced CNC systems. I’m also not very familiar with Node-Red.

ZYL_02
Member

Hello @Naz 

Please list your specific needs and email me. Yanling.ZHANG4@boschrexroth.com.cn 

Nathanael
Established Member

 

 

Must Read
Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist