Macro B

Post anything you want to discuss with others about the software.

Macro B

Postby Robertspark » Thu Dec 01, 2016 1:27 pm

I've been having a look with some interest recently about parametric programming and parameters.

Came across this document from a long time ago, I know the parameters listed within it are not relevant to uccnc at this time, would there be a problem with adopting them?
http://www.mattshaver.com/NCMS_RS274NGC.pdf

Seems like most of the information could be passed into and out of uccnc via a plugin which essentially references the appropriate field etc

Some of the 4001 to 4120 would need a means for them to be passed out of uccnc (I don't think this is available yet)
Likewise #5001 to #5006

Would this be possible? (i.e. are cnc drive happy to do this?)
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Macro B

Postby Robertspark » Fri Dec 02, 2016 8:13 am

An easy fix for cncdrive to allow for better plugin interface would be a means to prefix lines in gcode which could be passed directly to a plugin

Pick an unused letter
Eg, say
P(AND)

This would allow "AND" to be passed serially to a plugin.

And
Preturn

Would allow for something to be passed back from the plugin as a multi line gcode
Say
#1=20
G1 x100 f50
Could be passed back.
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Macro B

Postby Robertspark » Fri Dec 02, 2016 9:22 am

Anyone reading this thread, please note its just a sort of sounding out / brainstorming thread.
------------------------------------

After I posted the below, I thought you could just call a macro (M-code) which could return the plugin output
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Macro B

Postby Robertspark » Fri Dec 02, 2016 1:32 pm

Is there a way to pass something from G-code directly to a plugin?

I did think about getting a plugin to monitor a VAR, which if it changed from "0" to "1" would allow the plugin to collect all Vars / parameters (#) which may have been loaded previous by the gocde and perform conditional scripting.

Although complex, it may be possible to pass conditional statements via a var (#)

Say you set #150=1, that could pass a while statement to the plugin, or #150=2, an if statement... etc....
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Macro B

Postby cncdrive » Fri Dec 02, 2016 3:55 pm

Hi Rob,

Currently the only way to pass data between plugins and the macros is via the # variables,
because both the plugin and the macros can read and write the variables.

However for a while I'm thinking on a more complex solution to make it possible to pass generic object types back and forth,
because then anything could be passed from boolean to string and Arrays and Lists and anything you want.
I'm still working though on building the model in head only yet, but as soon as it will all become clear and when I will have some time then I'll implement it.
cncdrive
Site Admin
 
Posts: 4901
Joined: Tue Aug 12, 2014 11:17 pm


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 6 guests