Hello Guest it is April 24, 2024, 10:28:47 AM

Author Topic: Code Won't Load  (Read 10786 times)

0 Members and 1 Guest are viewing this topic.

Code Won't Load
« 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

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Code Won't Load
« Reply #1 on: January 02, 2007, 02:58:30 PM »
Is this an M code macro?

Graham.
Without engineers the world stops
Re: Code Won't Load
« 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

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Code Won't Load
« 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.
Without engineers the world stops
Re: Code Won't Load
« 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

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Code Won't Load
« 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.
Without engineers the world stops

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Code Won't Load
« Reply #6 on: January 02, 2007, 03:28:27 PM »
You don't have double parenthesis any where do ya?  (ActivateSignal(OUTPUT8)).

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Code Won't Load
« 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
Re: Code Won't Load
« 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

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Code Won't Load
« 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
fun times