Hello Guest it is April 28, 2024, 01:46:30 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - GTFreeFlyer

Pages: « 1 2
11
VB and the development of wizards / Ref All Axes - All at same time?
« on: October 17, 2014, 02:46:30 PM »
When I turn my machine on, the first thing I do is reference all the axes as I'm sure most people do.  Is it possible to modify the code so all axis move at same time, rather than z, y, then x?  I always move my spindle to a position that won't cause a crash before I hit the Ref All button.  Anything to save time!  I'm not sure if its possible to have all 3 axes operate simultaneously while monitoring the limit switches.

Example:  After hitting the Ref All button, all three axes start moving towards the limit switches.  As soon as one hits, it backs off the switch as usual, but the other two axes keep on moving and independently monitoring their limit positions.  Maybe it would be easier to have each axis stop as soon as it hits the switch, while the others keep on moving until all three are at their limits, and then each could back off independently (or at same time)?  I like the first option the best, but am just not too good at writing code, unless it is g-code :)  

I would further modify it to do a 2nd touch and a much slower feed rate for a little better accuracy.   Right now my machine coordinate (0,0,0) position slightly changes each time I do a Ref All.  I'm aware this is because of the poor quality and repeatability of my limit switches, but still this is extremely annoying because it forces me to complete a whole job in one session on the machine for fear of losing my WCS origin.  I think I'll get better results with a 2nd touch of the limit switches at a slower feed rate.

Thanks in advance for the help!

12
VB and the development of wizards / Re: Scripter compile error in
« on: January 18, 2014, 12:32:01 PM »
Working great so far.  I'm just fixing up some minor bugs.

Video:
http://www.youtube.com/watch?v=NFQ1A37kcGA&noredirect=1

Wizard screenshot:
https://www.dropbox.com/s/10addl8i6zrd3gg/screenshot.JPG

13
VB and the development of wizards / Re: Scripter compile error in
« on: January 17, 2014, 11:23:20 AM »
Yes thank you all for the info.  I seem to have the wizard working.  I plan to try my first cuts with it today.  I'll keep you posted on the progress.

14
VB and the development of wizards / Re: Scripter compile error in
« on: January 16, 2014, 12:55:22 AM »
One more thing, how do I fill out the description and author that is visible on the wizards menu?

15
VB and the development of wizards / Re: Scripter compile error in
« on: January 15, 2014, 09:35:30 PM »
Thanks for the help.  I used the editor in Mach3 and am getting the cursor to point to the syntax errors.

The first one is in an if/then statement.  Here's the snippet of code...
   If GetUserLED(1063) Then
      If FinishCutDirection = 1 Then
         Code "(Cut initial circle)                 G91 G3 x0 y0 i#1001 j#1002"
         Else
         Code "(Cut initial circle)                 G91 G2 x0 y0 i#1001 j#1002" 
      End If
      Code "(Set abs mode)                       G90" 
      Code "(Start finishing subroutine)         M98 P1234 L[90/#4005]"
      Code "(Move to final circle start)         x[#1001+#5002-#5007] y#1002 z[#1003-#2001]"
      If FinishCutDirection = 1 Then
         Code "(Cut final circle)                   G91 G3 x0 y0 i#1001 j#1002"
         Else
         Code "(Cut final circle)                   G91 G2 x0 y0 i#1001 j#1002"
      EndIf
      Else     
      Code "(Start finishing subroutine)         M98 P1234 L[360/#4005 + 1]"
   End If

It is highlighting the 3rd to last line, "Else", as the error.  Can I not nest the if/then statements as I did?

If you copy/pasted exactly as the script is, you have a typo in the 'END IF' above the else statement it is failing on.  you are missing a space.  Typos get to be a killer for stuff like this :)

regards,
Eric

Grrrr.  No matter how many times I looked at that, I missed it.  It doesn't use a space in another application I use for microchips so that's what I am used to seeing.  That's why I missed it.

16
VB and the development of wizards / Re: Scripter compile error in
« on: January 15, 2014, 09:23:06 PM »
There are two more syntax errors I'm getting:  The next one is from my last 2 lines of code:
CloseTeachFile
Call LoadTeachFile()
End Sub
Main
 
It highlights "End Sub" as the error.
 
And if I comment that line out of the code, it highlights the blank space on the next line of code after "Main" which is the last line.  I keep removing any blank characters or spaces after the last line, but every time I run the code it adds that blank character back and highlights the white space in the editor where the character would be.

17
VB and the development of wizards / Re: Scripter compile error in
« on: January 15, 2014, 09:17:59 PM »
Thanks for the help.  I used the editor in Mach3 and am getting the cursor to point to the syntax errors.

The first one is in an if/then statement.  Here's the snippet of code...
   If GetUserLED(1063) Then
      If FinishCutDirection = 1 Then
         Code "(Cut initial circle)                 G91 G3 x0 y0 i#1001 j#1002"
         Else
         Code "(Cut initial circle)                 G91 G2 x0 y0 i#1001 j#1002" 
      End If
      Code "(Set abs mode)                       G90" 
      Code "(Start finishing subroutine)         M98 P1234 L[90/#4005]"
      Code "(Move to final circle start)         x[#1001+#5002-#5007] y#1002 z[#1003-#2001]"
      If FinishCutDirection = 1 Then
         Code "(Cut final circle)                   G91 G3 x0 y0 i#1001 j#1002"
         Else
         Code "(Cut final circle)                   G91 G2 x0 y0 i#1001 j#1002"
      EndIf
      Else     
      Code "(Start finishing subroutine)         M98 P1234 L[360/#4005 + 1]"
   End If

It is highlighting the 3rd to last line, "Else", as the error.  Can I not nest the if/then statements as I did?

18
VB and the development of wizards / Scripter compile error in
« on: January 15, 2014, 07:06:39 PM »
I'm making my own wizard with Machscreen and have run into the following problem.

When clicking on the "POST CODE" button, nothing happens, and then when clicking on the "EXIT" button, I get back into Mach 3 (the latest version) and I get the message "Scripter compiler error: In"

The VB code assigned to my "POST CODE" button is very simple and I get no syntax errors.  It starts and ends just like all the other wizards...
Sub Main()
DoOEMButton (169)
OpenTeachFile "example.tap"
...
...
...
CloseTeachFile
call LoadTeachFile()
End Sub
Main

All the lines in between are mostly:  Code "example yada yada yada"

There are a few if/then statements which decide which "code" line to print to the file, but that's pretty much it.  All of the calculations are done in the g-code itself using #*********x variables, rather than in the VBscript. This makes for easy tweaking of the gcode file without redoing the wizard.

Why the compile error?

Pages: « 1 2