New UCCNC function

If you have a question about the software please ask it here.

Re: New UCCNC function

Postby Dan911 » Sat Oct 20, 2018 1:47 pm

Vmax549 wrote::twisted: I am stating a new function project. Teh object is to Make this line of Gcode work.

M65 (" if(6<=7){exec.Code("M98P2");} ")

Basically it is taking teh String inside of teh brackets and turn it into a working line of code INSIDE of teh M65 macro. I use Dezsoes M56 Code to retreive teh string. That was teh easy part.



Once shown how to do it's always the easy part....LOL

For here I used the split method to keep as string. What's needed/trick to do so UCCNC excepts as Gcode string is replace all code inside parentheses with brackets where parentheses are needed, the macro will replace the brackets with parentheses.

Example:

Your code>>>>>>>>>>>>>M65 (" if(6<7){exec.Code("M98P2");} ")

What's needed>>>>>>>>>M65 (" if[6<7]{exec.Code["M98P2"];} ")

Hope this helps,
Dan

This has no testing other than to see if works!

M65.txt
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: New UCCNC function

Postby Dan911 » Sat Oct 20, 2018 4:57 pm

When I tested I used a Z retract and worked fine, reason I deleted was I realized it wasn't reading the logical expression and code would run regardless. I'm fairly certain I could make it work but would take more than the few lines of code I quickly did in macro.

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: New UCCNC function

Postby Dan911 » Sat Oct 20, 2018 5:57 pm

Did you download the macro before I deleted it??

Follow the instructions of first post. Enable messagebox to see line of code. Not 100% working, will run code but not reading logic. Have a few ideas to make work 100%.
M65.txt
(336 Bytes) Downloaded 604 times


Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: New UCCNC function

Postby Dan911 » Sat Oct 20, 2018 11:13 pm

Hi Terry, Yes Operators can't be used in Gcode with UCCNC and is what I thought we were trying to be accomplish here. They also can't be used as a string and is what you must of tried to receive the error your referring to. The macro I uploaded was to show a way UCCNC will except your format in Gcode, when I tried originally with sample Gcode you posted I got errors and it was ignored. The way I see it there's three parts to accomplish this.

1. Create a format UCCNC will accept in Gcode.
2. Get a accurate string of logical expression.
3. Solve and insert.

Macro I posted shows 1,2 and part of 3 is fairly simple, solving from string is the fun and tricky part!

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: New UCCNC function

Postby Dan911 » Sun Oct 21, 2018 1:16 am

I disagree, I think it can be done. With a template condition and inserting the string variables in the proper order. Sometimes you have to think outside the box.

Just wish it was something I could use or others had interest in I would be more eager to give it a try. IMO...With good cam software so reasonably priced and Fusion for free this type of programing is becoming a thing of the past.

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: New UCCNC function

Postby Dan911 » Sun Oct 21, 2018 1:50 am

Terry I don't know what you mean already doable and not very practical. You just posted it cant be done :?
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: New UCCNC function

Postby Dan911 » Sun Oct 21, 2018 1:55 pm

Terry, I understood what you were trying to do from your first post and what sparked my interest, it seemed like you were stuck and was posting for help so I replied.

Were starting to post in circles with repeat post so I guess it will bring this function project to a end for me, but I will repeat also... your stumbling block isn't much of a stumbling block and the more I think about it it's not a stumbling block at all.


Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: New UCCNC function

Postby Dan911 » Mon Oct 22, 2018 11:28 am

Where there's a will there's a way!
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: New UCCNC function

Postby Dan911 » Thu Oct 25, 2018 4:55 am

Hi Terry, I get a bit obsessed with a challenge also and couldn't leave it alone....LOL. I have the arithmetic part worked out, tomorrow night Logical (Boolean and bitwise).

The attachment m65.JPG is no longer available


m65.JPG
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: New UCCNC function

Postby Dan911 » Thu Oct 25, 2018 9:46 pm

Vmax549 wrote:

HEY I THOUGHT we were done with this ??? :twisted: :o :? ;) :mrgreen:



If UCCNC doesn't have conditional Gcode and it's possible to do with macro or plugin than why not????

Here's a sample and pic to show its definitely possible to do. I only have 2 variables set now but enough to show it's possible, use any Relational (conditional) Operator. No "if" is needed now just put condition inside brackets inside parentheses

Example: M65 ([120<130])
the return will be "True"

The attachment conditional.JPG is no longer available



conditional.JPG
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Next

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 20 guests