Page 1 of 1

UCCNC Sycotec 4033 AC Spindle

PostPosted: Thu Aug 24, 2017 9:39 am
by figher_ionut
Hello,
I have a cnc machine from the bungard whose controller I modified and adapted for the ucccc software.
The controller I'm using is uc100.
The spindle chuck is pneumatically driven and I would like to do it by pressing a button in the uccn interface. How can I do this?
The cnc machine is equipped with ATC for 14 tools but I did not intend to use it for the time being.

Re: UCCNC Sycotec 4033 AC Spindle

PostPosted: Thu Aug 24, 2017 11:03 am
by dezsoe
Add a button to your screenset. (See documentation for details.) Use a button picture like yellowempty_down.png and yellowempty_up.png to show chuck state. Set buttonnumber to 20105.

Add this macro to your macro folder as M20105.txt:
Code: Select all
// ================================================================================================
// Chuck open/close
// ================================================================================================

if (AS3.Getbuttonstate(ChuckButton))
{                                                                     // Chuck is open -> close it
  if (OpenChuckOn1)
    exec.Clroutpin(ChuckPort, ChuckPin);
  else
    exec.Setoutpin(ChuckPort, ChuckPin);
  AS3.Switchbutton(false, ChuckButton);
}
else
{                                                                     // Chuck is closed -> open it
  if (OpenChuckOn1)
    exec.Setoutpin(ChuckPort, ChuckPin);
  else
    exec.Clroutpin(ChuckPort, ChuckPin);
  AS3.Switchbutton(true, ChuckButton);
}

// ================================================================================================

#Events

// ================================================================================================

const int ChuckButton = 20105;                                        // Must be the same as macro and button number

const int ChuckPort = 1;                                              // UC100 is always port 1
const int ChuckPin = 1;                                               // Set this to the output pin for chuck

const bool OpenChuckOn1 = true;                                       // True if chuck opens on pin high level else set to false

If your chuck opens on low level output, change in the last line true to false. Set ChuckPin to your output. If you changed OpenChuckOn1 to false, only then add the following line to M99998.txt (it will set the output high on stratup):
Code: Select all
exec.Setoutpin(1,1); // Port and pin, where port is always 1, pin is your output