Hello Guest it is March 28, 2024, 09:14:18 PM

Author Topic: piUpdate() delay question  (Read 3858 times)

0 Members and 1 Guest are viewing this topic.

piUpdate() delay question
« 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
Re: piUpdate() delay question
« Reply #1 on: July 04, 2016, 12:12:11 PM »
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??