Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 08:19:49 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  Double check when measuring tool
Pages: 1   Go Down
Print
Author Topic: Double check when measuring tool  (Read 263 times)
0 Members and 1 Guest are viewing this topic.
swanner
Active Member

Offline Offline

Posts: 57


View Profile
« on: September 29, 2011, 12: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...

* M15 new.m1s (1.11 KB - downloaded 16 times.)
* M15 old.m1s (0.8 KB - downloaded 9 times.)
Logged
Hood
Active Member

Offline Offline

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #1 on: September 29, 2011, 04: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
Logged
Sargon
Active Member

Offline Offline

Posts: 99


View Profile
« Reply #2 on: September 29, 2011, 04:58:40 AM »

For "greater than or equal to" the correct syntax is

">="

not

"= >"
Logged
BR549
Active Member

Offline Offline

Posts: 2,557


View Profile
« Reply #3 on: September 29, 2011, 09:36:58 AM »

Also has CodeSingle been released yet?

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

(;-) TP
Logged
swanner
Active Member

Offline Offline

Posts: 57


View Profile
« Reply #4 on: September 29, 2011, 12: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.

* M15 final.m1s (1.11 KB - downloaded 10 times.)
Logged
BR549
Active Member

Offline Offline

Posts: 2,557


View Profile
« Reply #5 on: September 29, 2011, 01:10:29 PM »

YEP that won't run on a standard Mach ver.

(;-) TP
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!