![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
Hello all, I'm wondering if it's possible to retrieve and store the status of the cutter comp (G-code 41 or 42) using a VB button script. I've got some center and z-height fixtures that I've made up using info from another thread, and here's what I'd like to do: 1) Retrieve and store the status of the cutter comp (G-code 41 or 42) using a VB button script. 2) Use the script to cancel it with G40, then run the auto tool zero script listed below. 3) Run the appropriate g-code (again G41 or G42) to get back to where I started. This would all be written into the VB script for the Auto Tool Zero button. I have already made some center and Z height fixtures, and got them to work using a VB script. Here's the problem, I'd like to be able to run the script in the middle of a program upon a tool change. When I try it, a couple of odd things happen. I get the message "Cannot probe with cutter radius comp on" and at other times, "Cannot change units with cutter radius comp on Line number #0". This latter one occurs when using the "Run from here" command, I think. There may be an easier way to do this, and if so, I'm all ears!! Thanks in advance! Here's the VB Script as I currently have it below for your reference. PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty Code "G40" 'This is to cancel the modal G41 or G42 code. (Added by mr. technical) DoOEMButton (1010) 'zero the Z axis so the probe move will start from here Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place Code "G31Z-2 F5" 'probing move, can set the feed rate here as well as how far to move While IsMoving() 'wait while it happens Wend ZProbePos = GetVar(2002) 'get the exact point the probe was hit Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun While IsMoving () Wend Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness Code "G4 P0.25" 'Pause for Dro to update. Code "G0 Z.3" 'put the Z retract height you want here Code "(Z axis is now zeroed)" 'puts this message in the status bar Else Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable Exit Sub End If |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Storing / Dispensing oil | laka | Safety Zone | 3 | 05-05-2008 10:15 AM |
| retrieving files? | bearracecars | Autodesk Software (Autocad, Inventor etc) | 2 | 09-17-2007 11:34 AM |
| Storing a K2 Out in the Shed.. | GuitarEng | Commercial CNC Wood Routers | 5 | 12-09-2006 02:38 PM |
| Retrieving Stepper Motors | andy_ck87028 | Stepper Motors and Drives | 16 | 10-25-2005 05:42 PM |
| storing mazatrol programs | laamar | General CNC (Mill and Lathe) Control Software (NC) | 3 | 03-11-2005 12:43 AM |