![]() | |
| 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
| |||
| |||
I have programmed in VBA before, but usually when I make a mistake, I am told exactly what is wrong, or at least where it is. So now that I am trying to add the "Aussie Auto Tool Zero" code with a copper plate, I am lost. The thread I am talking about is here: Another Aussie Auto Tool Zero Setter I have added the copper plate, and verified that it is working through the diagnostics screen. I edited the standard screen to include an LED and a user DRO for the plate thickness input. I then simply copied and pasted the code into the already present auto tool zero button. Here is the code I used: CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty 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-20 F100" '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 axact 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 Z20" 'put the Z retract height you want here Code "(Z axis is now zeroed)" 'puts this message in the status bar Code "F" &CurrentFeed 'Returns to prior feed rate Else Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable Exit Sub End If I know I will have to change the distances and the feedrates, but I haven't even gotten it to move at all. As soon as I click on the button, it comes up with a syntax error. Am I missing something else that needs editted in the screen? Or am I missing something even more basic? Let me know if you need any more information, I am not sure what else someone may need to diagnose the problem, or point me in the right direction. |
|
#2
| |||
| |||
I am still not sure what was wrong, but I used some code from mach support site instead of the code listed, and it all works fine. If anyone wishes to clear up why the above code didn't work, by all means, though! |
|
#3
| |||
| |||
| kiltjim The code you posted looks good. Don't know why it was not working for you. Just to be sure I was not missing some small typo, I pasted it directly from your post into Mach's VB scripter window and it ran as it should. What version of Mach are you running? There have been some versions with with problems running VB Greg |
![]() |
| 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 |
| Auto tool zero | wildcat | Mach Mill | 30 | 10-08-2010 12:03 PM |
| Problems with auto tool zero | Mephysto | Mach Software (ArtSoft software) | 3 | 12-14-2008 07:43 PM |
| Auto cad 3d draw to g-code | jorgeneo560 | Autodesk Software (Autocad, Inventor etc) | 5 | 08-03-2008 01:27 AM |
| Auto Tool Zero | Moondog | Machines running Mach Software | 13 | 12-22-2006 07:02 PM |
| syntax error | pyroracing85 | G-Code Programing | 9 | 01-27-2005 08:09 PM |