Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: swanner on September 29, 2011, 01:31:06 AM

Title: Double check when measuring tool
Post by: swanner on September 29, 2011, 01:31:06 AM
I have my router setup to measure tools from a fixed switch. I'm trying to modify it to where it touches twice, compares the values, and let's me know if it's out more than .002 off, then I want a message box to pop up with the difference in it. I'm getting a syntax error, probably something simple...
Title: Re: Double check when measuring tool
Post by: Hood on September 29, 2011, 05:22:40 AM
Not great at VB but think most of the syntax errors are because you have = > where likely it should just  be > with no =
Also  you have miissed out " at the end of the following
 MsgBox("Check switch - " & Zpos - ZposC & "measurement error)
Should be
 MsgBox("Check switch - " & Zpos - ZposC & "measurement error")
Then there is the CodeSingle, dont know what that is but Mach is not happy so presume it should just be Code rather than CodeSingle
I think you will likely have to put
While IsMoving()
Wend

after each movement command also.
Hood
Title: Re: Double check when measuring tool
Post by: Sargon on September 29, 2011, 05:58:40 AM
For "greater than or equal to" the correct syntax is

">="

not

"= >"
Title: Re: Double check when measuring tool
Post by: BR549 on September 29, 2011, 10:36:58 AM
Also has CodeSingle been released yet?

You also missed a couple of closing " around a statement or two.

(;-) TP
Title: Re: Double check when measuring tool
Post by: swanner on September 29, 2011, 01:45:17 PM
Thanks guys! Works great now. The 'CodeSingle'...that's just the way the software came setup. I'm running an Industry Control MCB-1 and it uses a modified version of Mach, under the version it says R4.000.000 Test...anyway, I've attached the finished file with corrections if anyone else is interested in it.
Title: Re: Double check when measuring tool
Post by: BR549 on September 29, 2011, 02:10:29 PM
YEP that won't run on a standard Mach ver.

(;-) TP