Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: ballistic42 on December 26, 2015, 02:39:47 PM

Title: Z Down Feed Rate DRO
Post by: ballistic42 on December 26, 2015, 02:39:47 PM
Ok I have a DRO called Z Down Feed.  I am trying to set the DRO so that in the VB Script Slow is = to a value like 10 and Fast is = to 30.  When I write the M6Start Macro script and I use this example,

'Z Down Move
Const Fast       = 0
Const Slow    = 1

This way I can use the 0 or 1 which then can be associated with a feed rate of 10 for slow and 30 for fast.  Here is what I have now for my VB script for what I called M2002, which stands for DRO 2002.  Anyone have any ideas?

ZDownFeedDRO = 2002                 'Z Down Feed DRO defined as 2002
SetUserDRO(ZDownFeedDRO, 30)      'Setting Z Down DRO to 30
MyDROVal = GetUserDRO(ZDownFeedDRO)   'Get current value of ZDownFeedDRO) 


Jeff
Title: Re: Z Down Feed Rate DRO
Post by: BR549 on December 26, 2015, 04:13:06 PM
It looks to me you are adding a lot of extra gizmo's to the script that serve no real purpose. It is akin to walking all the way around the block just to go next door.  Please do not take offense as you did ASK (;-)

(;-) TP
Title: Re: Z Down Feed Rate DRO
Post by: ballistic42 on December 26, 2015, 04:16:58 PM
TP none taken.  So than in your opinion it is something not necessary  to do then?
Title: Re: Z Down Feed Rate DRO
Post by: ger21 on December 26, 2015, 05:27:43 PM
Quote
ZDownFeedDRO = 2002                 'Z Down Feed DRO defined as 2002
SetUserDRO(ZDownFeedDRO, 30)      'Setting Z Down DRO to 30
MyDROVal = GetUserDRO(ZDownFeedDRO)   'Get current value of ZDownFeedDRO) 

The result of this will always be MyDROVal = 30. So why not just use the 30 wherever you plan on using it, and skip these 3 lines?

You typically use a DRO to either display values to the user, or get valuers from the user.

I'm not sure I've ever seen anyone set a DRO value, only to read it right back in.
Title: Re: Z Down Feed Rate DRO
Post by: BR549 on December 26, 2015, 05:55:23 PM
HIYA Jeff are you  working on this for your ATC ??   Normally you set all motion values and LEAVE them be . That way things are MORE predictable. There is nothing to gain by constantly jacking the Feedrate of the ATC up and down. Set it and forget it. IF down the road you want to adjust it then simply do so in the Script.

The simpler you make the control script for the ATC the easier it is going to be to get it working and trouble shoot it. I have never heard anyone complain that an ATC script was TOO SIMPLE (;-)

(;-) TP

   
Title: Re: Z Down Feed Rate DRO
Post by: ballistic42 on December 26, 2015, 06:09:11 PM
TP, Thanks for the input and yes the old adage KISS, I'm sure you know what that means.  This is my first time doing this or even messing with VB scripting but trying to learn.  I will get it and it will all come together at some point.  Thanks for all the help and input pointing me in the right direction.  I will post the screen I put together later tonight when I get home.  Some of the screen works but not all of the buttons function.

Jeff
Title: Re: Z Down Feed Rate DRO
Post by: BR549 on December 26, 2015, 06:16:20 PM
Jeff you are doing a fine job. It just takes time to learn it all.  If I could send you a six pack of " Done Learned It All " I surely would.

But then where would be the fun in that ??

(;-) TP
Title: Re: Z Down Feed Rate DRO
Post by: ballistic42 on December 26, 2015, 06:30:39 PM
TP, Iol good stuff!

Jeff
Title: Re: Z Down Feed Rate DRO
Post by: ballistic42 on December 26, 2015, 07:56:38 PM
TP, here is a screen shot of my Mach3 ATC screen11.  The LEDS For the Slide EXT/RET are so that I can see that they are going to the proper position, same as  the PDB LEDS.  In a big quandary of how to figure out how to write the code to get the Current Tool DRO, Current Slot DRO, Empty Spindle Button, Home ATC Button and Get Verify Tool Lengths button to work.   Any constructive criticism on the ATC screen would be helpful, as it's my first screen I have ever made.  I am going to pickup The slide cylinder, PDB FABCO-Air Pancake cylinder, air compressor, limit switches for the Slide Cylinder ext/ret inputs, PDB Grip/release inputs, carousel home switch input and one more 110vac air solenoid valve.  As you can see on the ATC screen, I have a relay that will open and close an air solenoid to blow air on the TTS tool after it is put back into the tool carousel.  I want to have everything hooked up even if it is just laying on the floor to see the stuff working.  To me making all the brackets to get the Tool Carousel mounted to the Mill Table won't be a hard as this programming stuff!

Jeff
Title: Re: Z Down Feed Rate DRO
Post by: ballistic42 on December 26, 2015, 08:01:07 PM
Wow that attachment was huge.  Here is a smaller one I hope.
Title: Re: Z Down Feed Rate DRO
Post by: BR549 on December 26, 2015, 09:00:00 PM
Looks decent from here(;-) One note teh Blue DROs with teh black letters are going to hard to read at times. I always pick White letters with a blue background as it has a much better contrast and much easier on old eyes.

On the tools assignments you may want to just consider the tool# and slot # as the same thing and use the Tool# in mach3 .  Otherewise you will have to create a swap table to drive and update the  ATC and that is something else you would have to maintain.

If I am creating a 10 tool ATC then I just use tool # 1-10 from the tool table. Yes you do have to edit the tool table IF you change out to a different tool. But that only takes less than  a minute to do 3 or 4 tools .  Mach3 assumes that tool# and slot# are the same for tool changes and does NOT provide a method of tracking them.

I may have a hot swap tool table somewhere here I will just have to look. I have only used one with a hotswap tool changer (not what you are building I think (;-) ) as they get complicated tracking tools and changes.
Title: Re: Z Down Feed Rate DRO
Post by: ballistic42 on December 26, 2015, 10:14:39 PM
TP, thanks for the encouragement!  Yes as you can tell I am not up to speed but working on that.  As for the tool table  I totally understand what you are saying.  I can just swap the tools around in the tool table to make things less complicated.  I think most of this is very overwhelming, but if it was easy everyone would be doing it!  

Say I have 16 tools in my tool table, which I do and I have tools 1-10 in the carousel but on the next project I need to put tool 13-16 in the carousel.   I would need to go into the tool table and swap tools 13-16 to be say tools 1-3.  If I understand you right that is how it will work.  So i just line select the tool in line 1 and move it to line 16 and take tool line 16 and move it to line tool 1 and so on.  I can see how that would work.

I hope to move forward more when I get all the hardware in my hands and have the limit switches wired up and working on the cylinders.  As you can see on the screen I have put the Input and Output labels next to the LEDS and buttons so that when writing the M6START macro the user can see what is going on.  I am a visual person so helps me understand the logic as well.

Jeff
Title: Re: Z Down Feed Rate DRO
Post by: ger21 on December 27, 2015, 07:32:04 AM
You could make a custom screen to handle the different tools.
Make 10 User DRO's to hold the actual tool number.
Say you put tools 13-16 in slots 4-7.
In your M6Start macro, read through the 10 DRO's to see if the tool number you're using is in there, and have the ATC load the correct tool.

So, if you have T14 M6, then your macro will read the DRO's, find out that tool 14 is in slot 5, and load tool #5, which will actually be tool 14.

Does this make sense?
It's similar to how our Morbidelli router works. It has a setup screen where  you tell it which tool # is in which slot.
Title: Re: Z Down Feed Rate DRO
Post by: ballistic42 on December 27, 2015, 11:33:33 AM
Ger, I think I see what you are saying and yes making another screen is not a big deal but making the logic in the Macro will be a challenge for me but with help from the members on the forum I could do it. 

One of the problems I am facing right now is my I/O space.  My control box is made up of a CNC4PC C32 with a ESS smooth stepper.  I ran out of I/O when I added a index pulse board for my spindle RPM.  To fix that problem I put a C52 board onto the ESS smooth stepper to add a third port.  I then needed another Output when I added two more solid state relays to the control box.  Those relays are connected to the C52 board with an RJ45. 

So I need 5 inputs now with the ATC tool changer.  2 inputs for the slide carousel cylinder for the extend and retract LEDS and 2 inputs for the Power Draw Bar cylinder Grip and Release LEDS.  The 5th Input would be the homing sensor for the Tool Carousel at start up of the program. 

My solution to this problem may be to take the Last Port on the C52 board and plug in a MODBUS from Automation Direct.  From what I can tell, the MODBUS could be connected to the C52 board with a RJ45 cable.  At that point I could use the MODBUS to handle the whole ATC functions.  If anyone has any knowledge of this please chime in and let me know.  If I had it to do over I would of used a Pokey with the ESS.

Thanks,

Jeff
Title: Re: Z Down Feed Rate DRO
Post by: BR549 on December 27, 2015, 10:23:55 PM
With the available number of 3 ports could you not consolidate some inputs to gain extras ?


Internally Mach3 only understands Tool# not Slot # there are no hooks to use a swap table setup directly. IF you have a tool changer you are limited to only use the Tool# as slot #

Slot1 = Tool#1
Slot2 = Tool#2
Etc.

In other controllers the tool table is linked to a slot# so you simply assign a slot# to a tool # in the tool table  and it then assigns the slot# to a tool#.

I am not sure you could pull that off in Mach3 without a plugin.

The way I have done it in the past is to create a swap table on a new page then you assign tools to slots and then press a button and teh script would then auto insert teh proper tool # info into mach3 tool table by tool #.  The ATC was reserved the number of slots in teh ATC and all the other tools were added in above that number so they were always available to call into play from teh ATC setup page.

Just a thought, (;-) TP