Machsupport Forum
Mach Discussion => Mach SDK plugin questions and answers. => Topic started by: arachid on July 03, 2016, 01:33:41 AM
-
Hi, i try to make my first plug in for mach3. i use vs2008 with Ed Bryson’s wizard.
my plug in work but with whne mach 3 not run a code but when he run a code there are 3-5 sec of delay.
my code in piUpdate():
if(pressure<GetDRO(1139))
if(!GetLED(2011)){
Code("M680");
SetLED(2011,1);
}
pressure is a value of pressure of the air system, dro1139 is the minimum value autorized.
led 2011 is a led to indicate at system when ready to check pressure.
when I initialise mach3 and remove air them my m680 work very fast and no trouble but when i execute a gcode them i remove air mach 3 wait 3-5 sec before execute my m680.
why this delay??
Thanks
-
I resolve my trouble by adding DoButton(1003); (or stop) before my code.
now i like to know is it posible to pass a m code from a text box on my form to Code, like Code(textbox1->text) ??? and how use string in my code??
exemple :
int i=680;
Code("m"+i);
or
int i=680;
string s="m";
s=s+i.ToString();
Code(s);
this code not work but how i can do it??