Hello Guest it is March 29, 2024, 06:26:14 AM

Author Topic: Double check when measuring tool  (Read 3142 times)

0 Members and 1 Guest are viewing this topic.

Double check when measuring tool
« 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...

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Double check when measuring tool
« Reply #1 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
Re: Double check when measuring tool
« Reply #2 on: September 29, 2011, 05:58:40 AM »
For "greater than or equal to" the correct syntax is

">="

not

"= >"

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Double check when measuring tool
« Reply #3 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
Re: Double check when measuring tool
« Reply #4 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.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Double check when measuring tool
« Reply #5 on: September 29, 2011, 02:10:29 PM »
YEP that won't run on a standard Mach ver.

(;-) TP