- Code: Select all
const double ZHeight = 5;
double Zpos = AS3.Getfielddouble(228);
bool stateNow = Zpos < ZHeight && AS3.Getbuttonstate(666);
if (lastState != stateNow) {
lastState = stateNow;
}
if(stateNow) {
exec.Miston();
while(exec.IsMoving()){}
}
else {
exec.Stopcoolant();
}
i made an extra button for MistOn while Cutting, and ZHeight at 5. So the Misting starts before the bit enters the material and still blows when it leaves. 5 is very save 1 or 2 should also work, the valve solenoid operates fairly quick and i generally only rapid to 3mm above the part.
i also used the execs directly so you can set the pin in option as usual, not tested yet because its effing cold right now in the Shop ^^