Modbus communication with HMI eliminating the PC

Moderators: TomKerekes, dynomotion

ajith
Posts: 65
Joined: Sat May 21, 2022 3:57 am
Location: TamilNadu

Modbus communication with HMI eliminating the PC

Post by ajith » Tue Jun 14, 2022 9:17 am

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.

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Modbus communication with HMI eliminating the PC

Post by TomKerekes » Tue Jun 14, 2022 6:26 pm

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.
Regards,

Tom Kerekes
Dynomotion, Inc.

ajith
Posts: 65
Joined: Sat May 21, 2022 3:57 am
Location: TamilNadu

Re: Modbus communication with HMI eliminating the PC

Post by ajith » Mon Jun 20, 2022 10:11 am

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

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Modbus communication with HMI eliminating the PC

Post by TomKerekes » Mon Jun 20, 2022 5:26 pm

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
Attachments
RO.c.txt
(277 Bytes) Downloaded 49 times
RW.c.txt
(277 Bytes) Downloaded 41 times
GCodeRW.scr.txt
(185 Bytes) Downloaded 42 times
GCodeRO.scr.txt
(183 Bytes) Downloaded 46 times
Last edited by TomKerekes on Mon Jun 20, 2022 9:43 pm, edited 1 time in total.
Reason: Oops I originally miss-read your response.
Regards,

Tom Kerekes
Dynomotion, Inc.

ajith
Posts: 65
Joined: Sat May 21, 2022 3:57 am
Location: TamilNadu

Re: Modbus communication with HMI eliminating the PC

Post by ajith » Fri Jun 24, 2022 11:43 am

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

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Modbus communication with HMI eliminating the PC

Post by TomKerekes » Fri Jun 24, 2022 5:42 pm

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.
Regards,

Tom Kerekes
Dynomotion, Inc.

ajith
Posts: 65
Joined: Sat May 21, 2022 3:57 am
Location: TamilNadu

Re: Modbus communication with HMI eliminating the PC

Post by ajith » Thu Jul 07, 2022 12:22 pm

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 973 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 973 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

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Modbus communication with HMI eliminating the PC

Post by TomKerekes » Thu Jul 07, 2022 4:44 pm

It seems you are still using V4.34.
Regards,

Tom Kerekes
Dynomotion, Inc.

ajith
Posts: 65
Joined: Sat May 21, 2022 3:57 am
Location: TamilNadu

Re: Modbus communication with HMI eliminating the PC

Post by ajith » Fri Jul 08, 2022 12:24 pm

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?

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Modbus communication with HMI eliminating the PC

Post by TomKerekes » Fri Jul 08, 2022 4:56 pm

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.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply