M6 ATC

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

M6 ATC

Postby frez1001 » Wed Aug 12, 2020 6:19 pm

Hello,

We got the linear ATC working with our rack tool changer. Sometimes out spindle is not stopped prior to changing a tool. (modified stock M6)

what is a good approach to waiting for the spindle to be stopped prior to continuing.

It uses modbus to control the vdf and we have a spindle stopped pin from the spindle itself.

the simplest is to just have it wait every time but that's no fun.

Thank you!
frez1001
 
Posts: 7
Joined: Wed Aug 12, 2020 6:12 pm

Re: M6 ATC

Postby dezsoe » Thu Aug 13, 2020 12:30 pm

You can get the state of the motor on Modbus (usually the at speed signal) or you can also use that signal you wrote. M6 should wait for the motor to stop by checking the state of the motor.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: M6 ATC

Postby frez1001 » Thu Aug 13, 2020 3:28 pm

thanks dezsoe, thats what i would like it to do, what syntax would you use to check the state
if command or while command? im not particularity good at programming

thank you
frez1001
 
Posts: 7
Joined: Wed Aug 12, 2020 6:12 pm

Re: M6 ATC

Postby dezsoe » Thu Aug 13, 2020 7:37 pm

How can you read the state? A while cycle will be the solution, but I can help only if I know how you get the motor state. (You need a while cycle to check the motor state and the stop state. If the morot stops or the user presses the stop then the cycle must exit.)
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: M6 ATC

Postby frez1001 » Thu Aug 13, 2020 8:17 pm

the spindle has a reed switch (or similar) that is on when the spinning and off when it is stopped. I will use one of the inputs from the abbb-e to read its state. im not sure how to get that information into the macro? is it an led state? its port 2 I6 i believe.

thank you!
frez1001
 
Posts: 7
Joined: Wed Aug 12, 2020 6:12 pm

Re: M6 ATC

Postby dezsoe » Mon Aug 24, 2020 10:12 am

Sorry, I forgot to reply you. Here is the code that waits for the port 2 pin 6 to go off:

Code: Select all
while (exec.GetLED(74) && !exec.Ismacrostopped()) // Port 2 pin 6 -> LED 74
  exec.Wait(10);

if (exec.Ismacrostopped()) // Stop (or reset) was pressed
{
  exec.AddStatusmessage("Stopped!");
  return; // exit the macro
}
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to Macros

Who is online

Users browsing this forum: No registered users and 6 guests

cron