Page 1 of 2

Modbus communication with HMI eliminating the PC

Posted: Tue Jun 14, 2022 9:17 am
by ajith
Respected Sir,
1. Is it possible to communicate with any HMI (via modbus also) and operate with kmotion CNC without using Computers?
2. Is there a way to lock the kmotion gcode screen with password so that noone can edit the gcode?
3. Is there an intenal memory available in the kflop so that we can save the gcode program.if it is possible whether the saved program can be
accessed without using computer?
4. Is there a way to handle kflop without using computer?




regards,
M.Ajith Arawinth.

Re: Modbus communication with HMI eliminating the PC

Posted: Tue Jun 14, 2022 6:26 pm
by TomKerekes
hi Ajith ,
1. Is it possible to communicate with any HMI (via modbus also) and operate with kmotion CNC without using Computers?
Well no, KMotionCNC runs on a Windows PC
2. Is there a way to lock the kmotion gcode screen with password so that noone can edit the gcode?
Not with a password. But if you right click on GCode Control there is a Make Read Only option

MakeReadOnly.png

Furthermore using a Screen Script you can set the Var parameter of the GCode Control to 2 to make it permanently read only. The values of Var are:

-1 = default behavior allow the Operator to change (R/W on startup)
0 = Set Read Only and allow the Operator to change
1 = Set R/W and allow the Operator to change
2 = Set Read Only and do not allow the Operator to change

Var2.png

I suppose you could set 2 for read only and then add a User button to run a C Program to ask for a password and if correct set to 1 using screen script.
3. Is there an intenal memory available in the kflop so that we can save the gcode program.if it is possible whether the saved program can be
accessed without using computer?
Not really. KFLOP only has 1 MByte of User Flash and no GCode Interpreter. Its somewhat complicated but some Users have saved relatively small jobs in Flash that could then be executed off-line. One example was a stand alone cake icing dispenser that could dispense "Happy Birthday" off line. The pattern is not saved as GCode but rather a small Job is run using KMotionCNC and then the Coordinated Motion Buffer in KFLOP is then saved and then re-loaded and re-executed off line. See the example in the folder:
C:\KMotion435f\C Programs\FlashNonVolatile\FlashCoordMotionBuffer\
4. Is there a way to handle kflop without using computer?
KFLOP can run stand alone using User C Programs in Flash Memory. But our Libraries for GCode Interpreter, Trajectory Planning, Kinematics run on the PC and require a PC. See the architecture here.

Re: Modbus communication with HMI eliminating the PC

Posted: Mon Jun 20, 2022 10:11 am
by ajith
Respected Sir,
Furthermore using a Screen Script you can set the Var parameter of the GCode Control to 2 to make it permanently read only. The values of Var are:

-1 = default behavior allow the Operator to change (R/W on startup)
0 = Set Read Only and allow the Operator to change
1 = Set R/W and allow the Operator to change
2 = Set Read Only and do not allow the Operator to change

Var2.png

I suppose you could set 2 for read only and then add a User button to run a C Program to ask for a password and if correct set to 1 using screen script.
normally i have been used the following c code for password authentication . but you suggested when the password is correct ,set the var parameter to 1.but i cant find the variable used to set "var parameter".
WhatsApp Image 2022-06-20 at 3.22.45 PM.jpeg

Re: Modbus communication with HMI eliminating the PC

Posted: Mon Jun 20, 2022 5:26 pm
by TomKerekes
Well no, scanf isn't supported. See the MessageInputBox.c example of how to ask the Operator for a value.

To change Var (or any parameter of a control) you can re-define it with the changed parameter using a screen sub-script. See the attached two screen SubScript files. One sets the Edit Control to Read Only and the other to Read/Write. Also two C Program examples on how to execute the SubScripts.

HTH

Re: Modbus communication with HMI eliminating the PC

Posted: Fri Jun 24, 2022 11:43 am
by ajith
Respected sir,
I had tried the subscript and c program and got the following error.
WhatsApp Image 2022-06-24 at 12.23.45 PM (1).jpeg
when i defined the subscript directly as a button and execute the subscript by pressing the button i got the below popmessage the kmotion cnc application got closed automatically.
WhatsApp Image 2022-06-24 at 12.23.44 PM.jpeg
next i had tried the c program that you had send.
WhatsApp Image 2022-06-24 at 12.23.45 PM (2).jpeg
i got the following error popped up.
WhatsApp Image 2022-06-24 at 12.23.46 PM.jpeg
i also checked the C program in dynomotion application and got the same error that "KflopToKMotionCNCFunction" not found
WhatsApp Image 2022-06-24 at 12.23.45 PM.jpeg
i also tried the way to get password but i can get the value from keyboard but i cannot compare the value in if clause the execute remaining program.
WhatsApp Image 2022-06-24 at 5.23.54 PM.jpeg
WhatsApp Image 2022-06-24 at 5.23.54 PM.jpeg

Re: Modbus communication with HMI eliminating the PC

Posted: Fri Jun 24, 2022 5:42 pm
by TomKerekes
Please use Version 4.35f.

Please grab screen shots with Alt-Print Screen rather than photos.

It looks like you have extra spaces in the filenames.

KFLOPtoKMotionCNCfunctions.c must be in the same folder as the C Program to be found if no path (absolute or relative) is specified.

Re: Modbus communication with HMI eliminating the PC

Posted: Thu Jul 07, 2022 12:22 pm
by ajith
Respected sir,
I tried to change the gcode screen in the kmotion cnc via c program in the below
ro ss.PNG
ro ss.PNG (7.96 KiB) Viewed 1709 times
i had executed the program by defining it as a button.
hg tool setup.PNG
when I executed the program i got the below popwindow.
und.PNG
und.PNG (8 KiB) Viewed 1709 times
KFLOPtoKMotionCNCfunctions.c must be in the same folder as the C Program to be found if no path (absolute or relative) is specified.
yeah its in the same folder
cnc2flop.PNG

ro im.PNG

Re: Modbus communication with HMI eliminating the PC

Posted: Thu Jul 07, 2022 4:44 pm
by TomKerekes
It seems you are still using V4.34.

Re: Modbus communication with HMI eliminating the PC

Posted: Fri Jul 08, 2022 12:24 pm
by ajith
Respected sir,

today only I have changed the Kmotion version.
may i know the procedure to save my C program in the kflop flash memory(ROM)?
how many program i can save in my kflop internal memory?
if i can save more than one program how can i able to access it without any computer?

Re: Modbus communication with HMI eliminating the PC

Posted: Fri Jul 08, 2022 4:56 pm
by TomKerekes
We don't recommend Flashing things to KFLOP unless you absolutely must operate without the PC

Each Thread can contain one program. There are 7 Threads.

Any Thread can be set to Execute on power up.

See the manual here.