C program to run G codes
Moderators: TomKerekes, dynomotion
C program to run G codes
Hi!
Is it possible to FLASH a G code program into KFLOP?
If it is not so, How can I run KmotionCNC program using C program?
I want to flash a Gcode program into the device. It is easier for me to run my application. Kindly suggest me a way to do that.
I think it is possible to run a G code program using C program.
Kindly guide me or send me a sample C program to "Run a G code program using a C program".
With regards,
Mani
Is it possible to FLASH a G code program into KFLOP?
If it is not so, How can I run KmotionCNC program using C program?
I want to flash a Gcode program into the device. It is easier for me to run my application. Kindly suggest me a way to do that.
I think it is possible to run a G code program using C program.
Kindly guide me or send me a sample C program to "Run a G code program using a C program".
With regards,
Mani
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: C program to run G codes
Hi Mani,
Does your system have a PC? If so it would be easier and better to run the GCode from a PC Application.
Without a PC, KFLOP only has ~1 MByte of Flash Data storage.
Does your system have a PC? If so it would be easier and better to run the GCode from a PC Application.
Without a PC, KFLOP only has ~1 MByte of Flash Data storage.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: C program to run G codes
Hi Tom,
We are using Kflop + Kstep device. Now we are running the application using KmotionCNC software without flashing the data. It is easy for us to run the application using the G-codes. But G codes cannot be flashed into the device directly. i.e. We are running the application by connecting the device with PC.
So, kindly suggest us a way to flash G codes.
If it is not possible, send us any sample C program to run the G codes.
With regards,
Mani.
We are using Kflop + Kstep device. Now we are running the application using KmotionCNC software without flashing the data. It is easy for us to run the application using the G-codes. But G codes cannot be flashed into the device directly. i.e. We are running the application by connecting the device with PC.
So, kindly suggest us a way to flash G codes.
If it is not possible, send us any sample C program to run the G codes.
With regards,
Mani.
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: C program to run G codes
Hi Mani,
I still don't understand.
If you have a PC in your system there is no reason to Flash GCode. Just save it on the PC and run it using our PC Libraries.
You might see the SimpleGCode C++ example or the KMotion_dotNet Console RunInterpreterExample() C# example.
See here for information on PC samples.
I still don't understand.
If you have a PC in your system there is no reason to Flash GCode. Just save it on the PC and run it using our PC Libraries.
You might see the SimpleGCode C++ example or the KMotion_dotNet Console RunInterpreterExample() C# example.
See here for information on PC samples.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: C program to run G codes
Hi Tom,
My question is, Now we are using the device with the help of PC without flashing the G codes we are running our application,
but we want to run the application without the help of PC.
For that I need to flash my G-codes into the device.
Kindly suggest me an idea to flash G codes.
Regards,
Mani.
My question is, Now we are using the device with the help of PC without flashing the G codes we are running our application,
but we want to run the application without the help of PC.
For that I need to flash my G-codes into the device.
Kindly suggest me an idea to flash G codes.
Regards,
Mani.
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: C program to run G codes
Hi Mani,
Ok so you don't want to use a PC.
KFLOP itself doesn't have a GCode Interpreter or Coordinated Motion Trajectory Planner. So Flashing GCode to KFLOP wouldn't work.
Maybe you could describe more clearly exactly what you need to do. Is it simple and small amount of GCode? Does it ever change?
Some users have created stand-alone systems that run fixed, simple, motion patterns using the technique described below. One of the first Users to do this created a stand-alone machine to write "Happy Birthday" on a cake with icing.
#1 - Connect a PC
#2 - Run a small GCode Job. This downloads "coordinated motion" to KFLOP's Coordinated Motion Buffer. This is basically a big list of equations.
#3 - Write the Coordinated Motion Buffer data to USER_FLASH memory
#4 - Disconnect the PC
#5 - Cycle Power
#6 - Copy the data from Flash back into the Coordinated Motion Buffer
#7 - Execute the motion
Here is a Yahoo Thread where a User created code to save multiple motion jobs to Flash memory and was able to selectively run them.
Does this seem like something you could do?
Ok so you don't want to use a PC.
KFLOP itself doesn't have a GCode Interpreter or Coordinated Motion Trajectory Planner. So Flashing GCode to KFLOP wouldn't work.
Maybe you could describe more clearly exactly what you need to do. Is it simple and small amount of GCode? Does it ever change?
Some users have created stand-alone systems that run fixed, simple, motion patterns using the technique described below. One of the first Users to do this created a stand-alone machine to write "Happy Birthday" on a cake with icing.
#1 - Connect a PC
#2 - Run a small GCode Job. This downloads "coordinated motion" to KFLOP's Coordinated Motion Buffer. This is basically a big list of equations.
#3 - Write the Coordinated Motion Buffer data to USER_FLASH memory
#4 - Disconnect the PC
#5 - Cycle Power
#6 - Copy the data from Flash back into the Coordinated Motion Buffer
#7 - Execute the motion
Here is a Yahoo Thread where a User created code to save multiple motion jobs to Flash memory and was able to selectively run them.
Does this seem like something you could do?
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: C program to run G codes
Hi Tom,
Regarding your previous reply, Can you elaborate the steps #3 , #5, #6.
Can you provide any sample Coordinated Motion Buffer program which could be flashed to USER_FLASH memory.
Regards,
Mani.
Regarding your previous reply, Can you elaborate the steps #3 , #5, #6.
Can you provide any sample Coordinated Motion Buffer program which could be flashed to USER_FLASH memory.
Regards,
Mani.
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: C program to run G codes
Hi Mani,
Did you read through the Thread I linked to?
Cycle Power means to turn power off and back on.
The Motion Program would be something you create (any simple GCode Program)
Did you read through the Thread I linked to?
Cycle Power means to turn power off and back on.
The Motion Program would be something you create (any simple GCode Program)
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: C program to run G codes
Hi Tom,
I followed your instruction, I ran my G code program which i had attached with this message.
After running the G code program, i want to flash that same G code program into the device.
So i used the below code
#define FLASH ((volatile char *)0x90000000) // beginning of FLASH - first 1MByte is for System Use
#define FLASH_USER ((volatile char *)0x90100000) // 2nd MegByte is for User use
I does'nt work.
My Question is, G code is already in running status, How can i run the COORDINATED MOTION BUFFER PROGRAM?
What should that COORDINATED MOTION BUFFER program have?
Because i am running the COORDINATED MOTION operation already with the G code itself?. Kindly explain..(i.e. Step #3)
Kindly send me a sample COORDINATED PROGRAM for my reference. It is easy for my to understand and execute.
I have read the Thread which you have sent. By i cant able to download or view the attachment with that thread.
Kindly send me any sample program to FLASH G codes.
Regards,
Mani
I followed your instruction, I ran my G code program which i had attached with this message.
After running the G code program, i want to flash that same G code program into the device.
So i used the below code
#define FLASH ((volatile char *)0x90000000) // beginning of FLASH - first 1MByte is for System Use
#define FLASH_USER ((volatile char *)0x90100000) // 2nd MegByte is for User use
I does'nt work.
My Question is, G code is already in running status, How can i run the COORDINATED MOTION BUFFER PROGRAM?
What should that COORDINATED MOTION BUFFER program have?
Because i am running the COORDINATED MOTION operation already with the G code itself?. Kindly explain..(i.e. Step #3)
Kindly send me a sample COORDINATED PROGRAM for my reference. It is easy for my to understand and execute.
I have read the Thread which you have sent. By i cant able to download or view the attachment with that thread.
Kindly send me any sample program to FLASH G codes.
Regards,
Mani
- Attachments
-
- G code for my project.txt
- (4.02 KiB) Downloaded 112 times
- TomKerekes
- Posts: 2677
- Joined: Mon Dec 04, 2017 1:49 am
Re: C program to run G codes
Hi Mani,
I plotted your GCode:
How much Coordinated Motion Buffer that is used will depend on the Trajectory Planner Smoothing and corner rounding. I ran the code with these typical settings:
The GCode took 42 seconds to execute and generated 4068 Coordinated Motion Segments and used 878KBytes of memory. Just under the 1MByte of Flash space available.
Attached is a MonitorParametricIndex.c program that will display on the Console how much Coordinated Motion Data has been downloaded as the GCode is running. When the GCode finishes it showed:
ParametricIndex=4068 (878688 bytes) 83.80 % TimeDownloaded=42.441sec
The attached example program called FlashCoordMotionWriteData.c will write the data to Flash.
The attached example program called FlashCoordMotionReadData.c will read the data from Flash and execute it.
Let me know how much of this you can understand.
Those are just defines for the compiler. It doesn't generate any code. You will need to study C Programming to be able to do this.So i used the below code
#define FLASH ((volatile char *)0x90000000) // beginning of FLASH - first 1MByte is for System Use
#define FLASH_USER ((volatile char *)0x90100000) // 2nd MegByte is for User use
I does'nt work.
I plotted your GCode:
How much Coordinated Motion Buffer that is used will depend on the Trajectory Planner Smoothing and corner rounding. I ran the code with these typical settings:
The GCode took 42 seconds to execute and generated 4068 Coordinated Motion Segments and used 878KBytes of memory. Just under the 1MByte of Flash space available.
Attached is a MonitorParametricIndex.c program that will display on the Console how much Coordinated Motion Data has been downloaded as the GCode is running. When the GCode finishes it showed:
ParametricIndex=4068 (878688 bytes) 83.80 % TimeDownloaded=42.441sec
The attached example program called FlashCoordMotionWriteData.c will write the data to Flash.
The attached example program called FlashCoordMotionReadData.c will read the data from Flash and execute it.
Let me know how much of this you can understand.
- Attachments
-
- MonitorParametricIndex.c
- (514 Bytes) Downloaded 107 times
-
- FlashCoordMotionWriteData.c
- (1.12 KiB) Downloaded 117 times
-
- FlashCoordMotionReadData.c
- (1.21 KiB) Downloaded 112 times
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.