Help Writing a Macro

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

Help Writing a Macro

Postby Balbers » Tue May 22, 2018 9:49 pm

I need help with a VERY simple custom macro but am unfamiliar with the language used for UCCNC in comparison to Mach3. For some reason no matter what I tried, mach 3 wouldn't work for me so I am trying this program to see about switching. It would run the macro just fine through the VB editor but when it actually came to running it during a program it wouldn't work, it would only activate or deactivate the spindle output.

The macro would replace the m3 and m5 macro and do the following:
M3:
activate spindle (
Sleep for xx seconds
activate second output


M5:
Deactivate second output
Sleep for xx seconds
Turn off spindle

Can anyone help me with the code for these?
Balbers
 
Posts: 2
Joined: Tue May 22, 2018 9:43 pm

Re: Help Writing a Macro

Postby Balbers » Tue May 22, 2018 10:07 pm

I actually ended up running through the M6 macro and I think I figured it out.
Balbers
 
Posts: 2
Joined: Tue May 22, 2018 9:43 pm

Re: Help Writing a Macro

Postby cncdrive » Tue May 22, 2018 10:23 pm

The prebuild macros which install with the UCCNC can be a good starting point to learn writting macros.
Also study the UCCNC/Documenation folder, there are some documents about macro coding.
And on the forum search for the user Robertspark, he made a nice summarised documentation.
And if you will still need help my collegue Dezsoe will help you on the forum.
cncdrive
Site Admin
 
Posts: 1924
Joined: Tue Aug 12, 2014 11:17 pm

Re: Help Writing a Macro

Postby Robertspark » Wed May 23, 2018 2:54 pm

Manual link below in signature VVVV
Rob

Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
UC400eth, UC300eth, UCCNC v1.2105, Neuron Lite.
UCCNC v1.2105 Macro Manual
Robertspark
 
Posts: 726
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: Help Writing a Macro

Postby Vmax549 » Wed May 23, 2018 9:28 pm

In case someone else is interested in how it is done as an example.

//M3 macro
exec.DospinCW(); //Start Spindle
exec.Wait(100);

exec.Wait(3000); //Wait 3000 ms , 3 secs

exec.Setoutpin(4,10); // Turn on output port 4 pin 10
exec.Wait(100);

_______________________________________________

// M5 macro
exec.Clroutpin(4,10); //Turn OFF output port 4 pin 10
exec.Wait(100);

exec.Wait(3000); // Wait 3000 ms , 3 secs

exec.Stopspin(); // Stop spindle
exec.Wait(100);
Vmax549
 
Posts: 981
Joined: Sun Nov 22, 2015 3:25 am
Location: USA


Return to Macros

Who is online

Users browsing this forum: No registered users and 0 guests