Hello Guest it is March 28, 2024, 06:40:45 AM

Author Topic: VB in Mach3 version 3.043.036?  (Read 4679 times)

0 Members and 1 Guest are viewing this topic.

VB in Mach3 version 3.043.036?
« on: June 12, 2011, 04:04:03 PM »
In the Change Log (May 2-2011) a lot of VB script changes were made. "Lots opf VB tools added for managing scripts (Check VB doc for added calls)". Is the VB doc in reference the "VBScript Command Reference" file in the Download Documents? Is Poppa Bear's doc "UPDATE to Mach Specific VB routines:" completely compatible with this change? I can't seem to get his "CodeSingle()" to work.

Thanks for any help.
Tony
Re: VB in Mach3 version 3.043.036?
« Reply #1 on: June 13, 2011, 03:02:05 AM »
Tony,
Alas, the mach release notes tend to be a bit "minimal"  :(
the entry for 3.43.36 on may/2 just says "lots of VB tools added"... this single entry attempts to cover close to a years development and dev release time. I happen to know this as I tracked the releases and the development of the "lots of VB tools" while developing MachStdMill during that period. The programmers ref manual is the best source of info re the "new" calls (almost all of which were added to the mach 3.43.xx series). As they were added, I included them in the programmers ref manual - the newer features will say "first added in mach version xx.yy.zz".

The latest programmer ref manual is pretty good wrt to being up to date on the available calls - it covers thru 3.43.37. A couple of things for turn were just added in 3.43.38 that I have not put into the doc yet.  Why am I updating the doc? 
Well, I ship the ref doc with MachStdMill (with ArtSoft's permission) and I strongly believe in proving good docs... also I do it because I can, and no one else seems to want to. I try to keep it up to date and send revisions to Brian as they are made - the idea is that he can post the updated pdf on the machsupport site.

I just looked and noticed that the doc on machsupport site doc is out of date - so attached is the latest rev I have.

Re your specific questions:
1) the PoppBear list was crossed checked against the ref manual about a month ago and I think that all the things on that list (which really work) are in the ref manual. If anyone knows of a discrepancy we can fix it.

2) CodeSingle never got implemented.
Assume that when you hand gcode to mach that it gets inserted into the gcode queue - and then mach returns to you before the code is done executing (IMHO a PITA, but mach is what it is).

To handle this I use the utility routines below -

Code: [Select]

Sub CodeQ(ByVal CodeString As String)
' QUEUE Up Code for Execution
  ' this function takes the passed g-code string and give it to Mach to be put
' into the Gcode queue for execution
'
'This routine does NOT wait for the code to be executed before returning to the caller

Code(CodeString)
Exit Sub
End Sub

Sub CodeQW(ByVal CodeString As String)
' QUEUE Up Code AND Wait for Execution to Complete
  ' this function takes the passed g-code string and give it to Mach to be put
' into the Gcode queue for execution
'
'This routine WAITS for all motion to stop before returning to the caller
Code(CodeString)
MotionWait(100)
Exit Sub
End Sub

Sub MotionWait(ByVal SVal)
' Wait for movement to complete
While IsMoving()
Sleep SVal
Wend
Exit Function
End Sub

Dave
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Re: VB in Mach3 version 3.043.036?
« Reply #2 on: June 13, 2011, 07:48:03 AM »
Thanks Dave, I'm impressed with how well you answered my questions. You've done a great job with the Programmer's Reference too. The old one I had was from 8-22-2010. I've copied you sub to handle the "wait" problem. pretty clever.

Keep up the good work.

Tony
Re: VB in Mach3 version 3.043.036?
« Reply #3 on: June 13, 2011, 10:32:37 AM »
Tony,
thanks for the kind words, but I can't take all the credit for the manual. Ray Livingston did the first version of the new manual, I just added the newer calls as they came along.
Dave
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com