Page 1 of 1

Detect input while moving

PostPosted: Fri Apr 05, 2019 6:44 pm
by Jeffsg605
I'm just trying to get more familiar with UCCNC. So I'm trying to move my machine and stop when I receive an input signal. This is the code I'm trying:


exec.Code("G91 X1000 F500");
while (exec.IsMoving())
{
if (AS3.GetLED(11))
{
exec.StopWithDeccel();
}
}

However it does not stop when I trigger pin 11 (Port 1 Pin 1). According to this page: (file:///C:/UCCNC/Documentation/LEDs_by_number.htm) pin 11 is Port 1 Pin 1. And I can see on the diagnostic page that the sensor I have connected to Port 1 Pin 1 is indeed switching state when I trigger it. How would I stop the machine with an input signal?

Thanks in advance.

Re: Detect input while moving

PostPosted: Fri Apr 05, 2019 7:55 pm
by eabrust
Jeffsg605 wrote: And I can see on the diagnostic page that the sensor I have connected to Port 1 Pin 1 is indeed switching state when I trigger it. How would I stop the machine with an input signal?

Thanks in advance.



I think that if you are on Port 1/Pin 1, you want LED 1 (not 11) .

regards
Eric Brust

Re: Detect input while moving

PostPosted: Fri Apr 05, 2019 9:56 pm
by ger21
Setup an Input trigger, with function 130 (Cycle Stop).

You don't need to write a macro.