122
« on: June 21, 2011, 01:18:08 PM »
Ok, so last night before my encoder trace problem surfaced, I finally had the Ah-Ha moment...
I realized what does what in this tool changer equation. I was getting the VB script for the toolchange Macro for Mach confused with the VB script that runs on the cubloc!
I discovered this when the cubloc studio VB editor would not reckognise VB commands that were used in Fdos's macro. When Cubloc studio did not reckognise these commands I realsied it was because I was trying to edit/run/test VB script that was native to Mach! Of course I could not use this in Cubloc studio! what was I thinking?
Now, I finally put it together that the VB script (macro) in Mach is a totally seperate piece of code from the VB script running in the Cubloc. Sure, they have to talk over modbus, but each has a distinct role to play.
Mach3 VB script Macro is used to call a toolchange (in MDI or Gcode). it determines what tool position it is in, and if it is not in the position that is requested by the toolchange, it changes the tool (only in Mach) it really only changes a DRO or Register.
Meanwhile, the Cubloc VB toolchange code has been monitoring the DRO or Register in Mach for any changes. If a change is detected, it preforms its toolchange physically by means of running its VB script that triggers relays which trigger air solenoids/airmotor. The VB script also interprets the position sensors for the turret rotational position and the turret up or down sensor. Using the information from these sensors allows the VB script to raise, lower, rotate, etc.. into the correct tool position.
Also, The Mach toolchange macro requests a move to safe Z&X locations suitable for a toolchange.
All thats left is for the Cubloc to report to the Mach macro that the tool has changed to the requested position, and that the turret is locked down correctly. The Mach macro can then allow the Gcode to resume with the new tool and its appropriate offset. IF the Cubloc does not sucessfully change the tool, the Mach macro should recieve a fault signal from the cubloc which triggers Mach to go into Estop mode.
I think I understand it all now!
Each piece has its role, and these roles must be kept seperate in my mind and in reality if this toolchanger is going to be made to work.
NOW, I am awaiting a call from Garret at Cubloc (Comfile) to ask him to help me setup Modbus communication between Mach and the Cubloc.
__________________
Does it look like my understanding of how this all works together is correct?