Hi IAN, WHen Mac see a t# it stores it in a var or buffer. At the M6 call it processes that var.
Yep - agreed - no problem so far.
After the M6 has finished mach then loads up the NEXT t# into the var/buffer.
Well - not quite I think - from what I've seen, Mach doesn't store the T# in the var until it subsequently processes the line the T# is on. Let's be exact here - its the only (good) way to spec software. And here's the first issue. You want to be able to read the next T# as soon as you've loaded the previous tool into the spindle - that's why you need a lookahead mechanism OR you need to pre-process the gcode to move the next T# to immediately after the M6 so that your macro pump routine can get started on it asap.
SO that var is available to use from a brain/pump to active a MACH ouput pin that can control a relay.
OK - this is what I was looking for in my last post - I thought Art may have sneeked a soft interrupt in there somewhere but polling is ok - I can go for that.
the brain/pump then can watch for the proper ID signal combination from the abs encoder to let mach know when to deactive or resignal for a stop.
OK
You will notice that the example page has the SLOT# as the primary id and the TOOL# as the variable. THis will be the easiest for the operator to track. He first has to load the carousel and inoput what tool went into what slot. Also at any time he must be able to verify the tool# and slot. SO I thought a PAGE with dros would work well here.
Mach can keep the dros as persistant dros and we never loose the info from job to job or shut down to startup.(I think)(;-)
The GoToSlot# allows the operator to rotate to a slot to unload/load a tool from the carousel.
OK - personally I wouldn't worry about all this at the moment - I'd get a basic simple harness working and worry about this later - but hey - its your call. FWIW I personally think the practice of using DROs as variables is messy but whatever - I know a lot of people do it.
Would I need a table to load up from the dros so VB could work its magic and track the hotswapping and keep the dros updated as well??
Well not really - if you can access your DROs from your code to populate a table (which of course you can) then you can do whatever directly on them. Different types of data structures are used because of the particular advantages they bring over each other in manipulating their data. VB has pretty p*ss poor data structures anyway so I wouldn't worry about it.
Now - hotswapping - if you can rotate your carousel whilst the axis are moving - the whole point here - why do you need hotswapping?
Can your example of hot swap work in this instance?? I know you had the tool# as prim ID and the slot as the variable(;-)
Well it was just that - an example - but it could be changed to do whatever you want - but see above - hotswapping - why do you need it?
Ian