Hello Guest it is March 28, 2024, 12:25:24 PM

Author Topic: Can you use Inputs with Macro B Programming.  (Read 6214 times)

0 Members and 1 Guest are viewing this topic.

Re: Can you use Inputs with Macro B Programming.
« Reply #30 on: November 22, 2017, 08:19:09 AM »
I checked the code this morning.  If I don't have the M98 in the loop, it doesn't go back to check the condition, it does the loop infinitely.

But I put the M98 back in the loop and it ran through the code just fine.  That's what's so strange about it, most of the time it works, but sometimes it hangs on that M98 line.
« Last Edit: November 22, 2017, 08:28:43 AM by Cbyrdtopper »
Chad Byrd
Re: Can you use Inputs with Macro B Programming.
« Reply #31 on: November 22, 2017, 08:38:30 AM »
Going back through the Hobby Version, running some tests.  My DRO's and #VARS are not linked anymore.  They were working fine yesterday, this morning they stopped working correctly.

The Industrial version, the DRO's and #VARS still do not work together properly.
Chad Byrd
Re: Can you use Inputs with Macro B Programming.
« Reply #32 on: December 07, 2017, 11:53:35 AM »
The Mach Support team is now aware of this issue.  I did have 1 DRO working correctly so I just copied it a bunch of times.  I got the Macro B Programming working nicely as well.  Thanks to Steve for pointing us to this book, we purchased the "Fanuc CNC Custom Macros" By Peter Smid, A wonderful book to learn how to write custom macros.
I got my issues fixed with the While Loops as well, a mistake on my end.  I took the loop out of the main program and put the loop in a Sub Program and it worked as expected.

Some things that I learned:
ORGANIZATION!!
In the book Peter Smid says to have a detailed plan laid out.  A very helpful tip.  Our plan was already laid out in Mach3 format, so I had to transfer that info from VB Script into Macro B.  Having it detailed and organized to begin with saved a lot of time. 
I did re-organize some sections to improve work flow, but again, I did it to start out to make my life easier.

Take/Make Notes in the Code.
When creating new variables (#VARS) or "N" lines, put it at the top of your code as a reference to keep track of what has been used and for what purpose.
I Made several notes in each section of the code.  Better to overstate what you did or are doing rather than question what you did a week or year later.

Work on a piece at a time.
I'm really bad at trying to cram in as much work at one time.  With this project, I took my time.  I first worked on the most basic function we use, the Grind to Dimension section of code first.  I got it working the way I wanted and moved on to Plunge Grinding.
This made it easy to re-use the Heart of the grinding code over and over in one sub program. 

Tidy Everything Up
Once I was happy with my first draft of fully finished code, I went through the entire code, made note of #VARS and "N" lines I missed.  Cleaned up some notes and cleaned up the Code. 
I sorted it out into sections, this made making further changes a breeze.

I took a quick video of Dad running the code on the machine.  It took about 2 hours to install Mach4 and get it running this new code. 
We are very pleased at the functionality of this Macro B Programming.  It is very powerful and it seems, so far, to be very reliable with Mach4.
Thanks for all who helped me out in this project.
Chad Byrd
Re: Can you use Inputs with Macro B Programming.
« Reply #33 on: December 07, 2017, 02:11:13 PM »
https://www.youtube.com/watch?v=gf8KETp5PCY
Here is a link to the video I took this morning.
Mach4 Macro B Programming.

Move to the left side of what is to be ground.  This is to Check our "Left End" Position
We touch off the part. 
Grind to Final Dimension + .0015"
Check the Dimension, and adjust the Y Position if necessary
Type in final dimension in the "Grind to Dimension" DRO.
Grind
Check the dimension. 
Chad Byrd

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Can you use Inputs with Macro B Programming.
« Reply #34 on: December 07, 2017, 03:59:52 PM »
Nice job!  That is a perfect use for Macro B.

Steve
Re: Can you use Inputs with Macro B Programming.
« Reply #35 on: December 07, 2017, 05:20:20 PM »
Thanks, Steve.
It was a lot of fun learning and writing this Macro B Code. 
Thanks for all the help, and the references.  We purchased that book, it is a gold mine of information. 
I'm anxious to get the Auto Measure System put on the machine.  I just finished machining the top side of the riser plate for the Unit, hopefully going to test the fit tomorrow when I get it finished.
Chad Byrd

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Can you use Inputs with Macro B Programming.
« Reply #36 on: December 07, 2017, 05:22:25 PM »
Any Smid book is a good book.  That guy does a good job. 

Steve
Re: Can you use Inputs with Macro B Programming.
« Reply #37 on: December 14, 2017, 04:52:31 PM »
Here is a video of our In Process Gauging.
This is working out great!!  It was holding within 0.0001" on over 100 parts, then we set up on another operation. 
https://www.youtube.com/watch?v=kOIo9YLQ3cQ&t=27s
Chad Byrd