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: 2366
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”
...working my way through the 1000+ ways things don't work to find the one that does
UC400eth, UC300eth, UCCNC v1.2106, Neuron Lite
UCCNC v1.2105 Macro Manual
Robertspark
 
Posts: 1096
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: Help Writing a Macro

Postby asuratman » Fri Jul 13, 2018 5:27 am

Manual link below in signature VVVV


All instructions used in UCCNC are all in the UCCNC MACROS - 1-2105, nothing else. So if we want to learn the macro, these all instructions in the UCCNC MACROS - 1-2105 needed.
asuratman
 
Posts: 39
Joined: Sun Jan 28, 2018 1:50 pm

Re: Help Writing a Macro

Postby Robertspark » Fri Jul 13, 2018 5:49 am

You use c# methods / statements / functions too

I was told these are missing from the manual, not got around to adding them yet, too busy at present
I found that some methods are missing. Here is a list of methods to add :

1. void Codesync(string code)
2. void Additemtolistbeginning(bool isAS3, string val, int labelnumber)
3. int Setselectedindexinlist(bool isAS3, int labelnumber, int index)
4. void Addled(bool isAS3, double x, double y, double w, double h, bool blinktype, int picturenumber, int LEDnumber, int layernumber)
5. void Addled(bool isAS3, double x, double y, double w, double h, int picturenumber, int LEDnumber, int layernumber)
6. void Sendallbuttonsup(bool isAS3)
7. int Getfieldint(bool isAS3, int labelnumber)
8. double Getfielddouble(bool isAS3, int labelnumber)
9. long Getcodetotalruntimemsec()
10. void Pluginshowup(string Pluginfilename)
Rob
Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
...working my way through the 1000+ ways things don't work to find the one that does
UC400eth, UC300eth, UCCNC v1.2106, Neuron Lite
UCCNC v1.2105 Macro Manual
Robertspark
 
Posts: 1096
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England


Return to Macros

Who is online

Users browsing this forum: No registered users and 0 guests