Jump to content
Macro Express Forums

How To Run 2 Macros At The Same Time?


wsam7

Recommended Posts

Macro A is what i am running now, i want Macro B runs every 1 mins.

 

Macro A is a forever loop, becas it never ends, so even i use Macro B in Scheduler it just queue up and wait and wait...

 

is there a way in Macro A can pause every x mins and run Macro B and continue Macro A?

 

 

Macro A:

 

delay 4 sec

repeat until T1 = 1

text type 1

delay 1 sec

repeat end

 

 

Macro B:

text type 2

Link to comment
Share on other sites

Macro Express will only run one macro at a time.

 

You may be able to come up with a work-around using the Macro Run command. Suppose you have macro C control macro A and B. Macro C would be in a loop repeatedly calling macro A. Once in a while, when conditions are right, macro C would instead call macro B.

 

To schedule the macro to run at specific times you could use the Date/Time command to get the current time. You would have to write some routines that calculate whether the correct amount of time has elapsed. There are macros available to do this. See either the PGM Functions Library or Date/Time Differences Calculator.

 

The PGM Functions Library contains over 100 functions that you can use in your macros. The Date/Time Differences Calculator is from our free library of macros available from our Shared Macros page.

Link to comment
Share on other sites

i have been thinking, may be i can use a checking on hour

 

if hour now is different to old hour, run this.

 

old hour = T1

new hour = T2

 

loop start----

store now hour in T1

compare it to T2

if T1 > T2

T2 = T1

run macro B

end if

loop end----

 

 

so this will run MacroB every hour

 

but i have trouble using

repeat until T1 = 1

xxx

xxx

xxx

repeat end

 

this will make my cpu become 100% usage and make it really hot.

 

if there a way to loop forever without making cpu = 100%??

Link to comment
Share on other sites

There are protections in the macro commands that are meant to prevent 100% CPU utilization. However, to make sure, you should include a Wait Time Delay or Wait for Time to Elapse command. From the Macro Expres help:

The Timed Delay in Seconds option puts Macro Express into a "wait state" where virtually no CPU cycles are used, thus allowing CPU intensive programs to continue uninhibited.

Note that when the Wait Time Delay or Wait for Time to Elapse macro command is running, you cannot stop the macro.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...