Hello Dear Tom
I have few questions..
Question 1 :
I want to run g code files with the ReadBit command, for example;
if (ReadBit(30)) { "open IDC_Thread1" }
if (ReadBit(31)) { "open IDC_Thread2" } .... Is this possible?
Question 2 :
Addition, I want to write a command that will convert the X values in the g code selected in IDC_Thread4 from positive to negative.
for example, the data in the g code file If "G0 X100 Y20 Z50" this code will translate as "G0 X-100 Y20 Z50"
I searched the forums and couldn't find a solution or I missed it.
Run IDC_Thread1..2...3 with button and convert g code
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Run IDC_Thread1..2...3 with button and convert g code
Here is an example to click a control,
You might have a C Program that reverses the direction of an axis. ie reverses the Output Gain (and Input if necessary)
Code: Select all
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
void main()
{
if (ScreenScript("WinMsg:DlgName;IDC_Thread2;BM_CLICK;"))
printf("Screen Script Failed\n");
else
printf("Screen Script Success\n");
}
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: Run IDC_Thread1..2...3 with button and convert g code
Dear Tom
This code ;
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
void main()
{
if (ScreenScript("WinMsg:DlgName;IDC_Thread2;BM_CLICK;"))
printf("Screen Script Failed\n");
else
printf("Screen Script Success\n");
}
Perfect working, thank you very much for fast response.
Regarding the second question;
There are 4 regions in CNC work areas and in some regions the x value needs to go in the opposite direction. Can we make a solution like this? for example ;
When IDC_Thread4 is turned on, it reads the g code, converts the x values from positive to negative and updates the g code file.
This code ;
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
void main()
{
if (ScreenScript("WinMsg:DlgName;IDC_Thread2;BM_CLICK;"))
printf("Screen Script Failed\n");
else
printf("Screen Script Success\n");
}
Perfect working, thank you very much for fast response.
Regarding the second question;
There are 4 regions in CNC work areas and in some regions the x value needs to go in the opposite direction. Can we make a solution like this? for example ;
When IDC_Thread4 is turned on, it reads the g code, converts the x values from positive to negative and updates the g code file.
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Run IDC_Thread1..2...3 with button and convert g code
There isn't currently a means of reading which GCode Thread is selected.Regarding the second question;
There are 4 regions in CNC work areas and in some regions the x value needs to go in the opposite direction. Can we make a solution like this? for example ;
When IDC_Thread4 is turned on, it reads the g code, converts the x values from positive to negative and updates the g code file.
It isn't clear what you are trying to achieve. Why not just load mirrored GCode into the appropriate GCode Threads?
Why not create a button or MCode to set the Mirror mode?
btw there is a simple Transform feature that can be used to scale x values by -1. But there is no programmable access to it.
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.