Hello Guest it is June 26, 2019, 02:58:22 PM

Author Topic: Macro Question  (Read 3575 times)

0 Members and 1 Guest are viewing this topic.

Offline mhdale

*
  •  130 130
  • Knowledge is the Treasure.
    • View Profile
    • Black Dragon Technologies
Macro Question
« on: November 14, 2007, 04:03:38 PM »
Some of you might know I am working on a pretty weird machine, We have been doing some testing and I have come across an issue that I am not sure if its a BUG on my part or if its just sometrhing I overlooked until now. When I load my Program (which consists mainly of a bunch of MACRO calls ) There is a particular macro I WANT to run during program LOAD to SET some configuration info before the cycle start is pressed. On Most of my Macros I have a If ISLOADING() THEN statement which wont run them if the system is loading a file. I have 2 config macros which I want to setup some systems settings when the file is loaded, I though they were working but I may have just had the settings correct to begin with. When I load my FILE I SEE the LED's for the required settings come on, but they go off again almost immediately. None of my other macros are re-setting these LED's. Is there ANY way to make this Macro Set those settings when the file is loaded?

vmax549

*
Re: Macro Question
« Reply #1 on: November 14, 2007, 04:36:22 PM »
Go to the config page and  find the check box that says ignore Mcodes on file load and check it. That way they will run in the order you have them as soon as you Press cycle start. OTher wise mach may try to prerun them on startup of the file.

Just a thought.  (;-) TP
« Last Edit: November 14, 2007, 04:39:00 PM by vmax549 »

Offline mhdale

*
  •  130 130
  • Knowledge is the Treasure.
    • View Profile
    • Black Dragon Technologies
Re: Macro Question
« Reply #2 on: November 14, 2007, 04:51:25 PM »
Thats just it, I WANT to PRE-RUN them on File LOAD and they dont seem to be doing what they should. All of the other Macros used have Code to prevent them from running, but I need these two macros to configure the system properly so that when the cycle start is pressed everything for that file is ready to go.
Mike

vmax549

*
Re: Macro Question
« Reply #3 on: November 14, 2007, 08:11:14 PM »
I can't say that I have ever tried it that way. Post some code and we can give it a whirl. to see if we can figure out a way.

(;-) TP

Offline mhdale

*
  •  130 130
  • Knowledge is the Treasure.
    • View Profile
    • Black Dragon Technologies
Re: Macro Question
« Reply #4 on: November 20, 2007, 12:13:45 PM »
Ok, For example You have a JIg on Your CNC bed which is configured for a job automatically via macros. When you Load the Program it configures your jig. All my Macro does it set three outputs in the appropriate state. I double checked my program and have made sure that it is NOT resetting because of something In the program. It Does RUN the macro when it loads the program, but it seems to also RESET the outputs that the macro sets upon loading. If I run the Macro by Itself it sets the outputs and they stay on. If I run the macro via loading it in a program (Loading NOt Running) it will set the outputs and then reset them. I dont think there is anything that can be done within my screen or in my macros to "fix" this.....

vmax549

*
Re: Macro Question
« Reply #5 on: November 20, 2007, 03:05:16 PM »
That SOUNDS like you need to go to config and check the box"ignore MCode on file load"

so that Mach does not try to run the Macode on file load and again when the file starts.

Just a thought, (;-) TP

Offline Graham Waterworth

*
  • *
  •  1,861 1,861
  • Yorkshire Dales, England
    • View Profile
Re: Macro Question
« Reply #6 on: November 22, 2007, 02:01:40 AM »
Hi Mike,

Are you toggling the outputs or setting the state?

Is the macro looping or called twice within the load.

How about setting a user LED and see if that resets.

Graham.
Never give up, time will pass, the cloud will clear, the sun will shine once more.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Macro Question
« Reply #7 on: November 22, 2007, 09:01:52 AM »
Hi mhdale - I think you're correct in thinking that although your initialization macro runs and sets your outputs as you require, the system is then doing a reset and turning them back off.

Have you thought of achieving what you want by simply putting a doButton(3) as the last line of your initialization macro. Then you can forget about pre-initialization and just run your program and it will stop at the end of your macro - you then just hit cycle-start to continue.

Just a thought

Ian