Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:58:12 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Code Won't Load
Pages: 1 2 »   Go Down
Print
Author Topic: Code Won't Load  (Read 2576 times)
0 Members and 1 Guest are viewing this topic.
01sporty
Active Member

Offline Offline

Posts: 44


View Profile
« on: January 02, 2007, 02:19:33 PM »

I wrote the following routine to cycle an air cylinder.  It work just fine when run from MDI.  But, when I put it in a program, Mach3 loads until it reaches the line with this macro then quits loading.

While IsActive(Input2)
ActivateSignal(OUTPUT8)
Wend
While IsActive(Input3)
DeActivateSignal(OUTPUT8)
Wend

Could I get suggestions on how to fix this??

TIA
Walt
Logged
Graham Waterworth
Administrator
*
Online Online

Posts: 1,665


West Yorkshire, England



View Profile WWW
« Reply #1 on: January 02, 2007, 02:58:30 PM »

Is this an M code macro?

Graham.
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
01sporty
Active Member

Offline Offline

Posts: 44


View Profile
« Reply #2 on: January 02, 2007, 03:02:49 PM »

Sorry, I should have specified that.  Yes, I'm using M110 for this bit.

Walt
Logged
Graham Waterworth
Administrator
*
Online Online

Posts: 1,665


West Yorkshire, England



View Profile WWW
« Reply #3 on: January 02, 2007, 03:10:07 PM »

Have you got the macro saved in the correct directory.

If you are using a profile it must be in the profile's macro directory.  If not then in Mach3mill or Mach3turn's directory.

Graham.
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
01sporty
Active Member

Offline Offline

Posts: 44


View Profile
« Reply #4 on: January 02, 2007, 03:16:17 PM »

Yup.  I already made that mistake.  (see my post of a few days ago)  I always try to make sure my mistakes are new and fresh (to me anyway).

Like a said, if I run the macro from the manual data input line, it does just fine.  It just doesn't like to load once I put it in a program.  Once again, I'm sure I must be overlooking some small but significant detail.

Regards,
Walt
Logged
Graham Waterworth
Administrator
*
Online Online

Posts: 1,665


West Yorkshire, England



View Profile WWW
« Reply #5 on: January 02, 2007, 03:27:55 PM »

Has the last line of the macro got a carriage return on it?

Will you post the macro and let me have a try here.

Graham.
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
Chaoticone
South Carolina, US
Administrator
*
Offline Offline

Posts: 3,598


Precision Chaos



View Profile WWW
« Reply #6 on: January 02, 2007, 03:28:27 PM »

You don't have double parenthesis any where do ya?  (ActivateSignal(OUTPUT8)).

Brett
Logged

Grin If you could see the things I have in my head, you would be laughing too. Grin
www.precisionchaos1.com
My guard dog is not what you need to worry about!
01sporty
Active Member

Offline Offline

Posts: 44


View Profile
« Reply #7 on: January 02, 2007, 04:20:11 PM »

More info.

The M code is just what I originally posted:

While IsActive(Input2)
ActivateSignal(OUTPUT8)
Wend
While IsActive(Input3)
DeActivateSignal(OUTPUT8)
Wend


Input2 & 3 are micro switches.  Output8 is to a solenoid to activate the air cylinder.

Everything is being run through a G100 & Mach3 version 2.0.010.

The code appears to run just fine on another computer that isn't actually driving anything.  The other computer is also running version 2.0.028.

I suppose I should try upgrading the machine computer to 2.0.028 and see if that helps.  But, before I do that, I'll probably try the xml file from the computer that doesn't work in the computer that does work.  If the problem follows the xml file I may be a bit closer.

Regards,
Walt
Logged
01sporty
Active Member

Offline Offline

Posts: 44


View Profile
« Reply #8 on: January 02, 2007, 04:51:59 PM »

Well, upgrading to 2.0.028 did the trick.  I get so used to Mach3 being bullet proof, it just doesn't occur to me to check it.

Now, if I could just solve the limit switch problem...............

Thanks for all the support.  Sometimes it just takes a couple of fresh perspectives to get pushed in the right direction.

Regards,
Walt
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #9 on: January 02, 2007, 05:20:17 PM »

NOTE: you also have to put ALL caps in the word "INPUT", from my understanding, when your looking at one of the functions, i.e. INPUT, OUTPUT, INDEX, (whatever).  The all caps lets the vb interpreter recongize the Mach specific call.  At least that is my understanding. (see below).

While IsActive(INPUT2)
ActivateSignal(OUTPUT8)
Wend
While IsActive(INPUT3)
DeActivateSignal(OUTPUT8)
Wend


see if that doesn't clear up your input problem.

Scott
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Pages: 1 2 »   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!