Jump to content
Macro Express Forums

Macros and a Network


MGuyM

Recommended Posts

Hi all,

 

I need some help with a potential dilema I've been trying to sort out. I have about 2 Dozen different Macros that I run on a single PC. I'm considering setting them up to run on multiple computers in my Network because the work load is becoming too great for just one PC to handle. Without addressing the Licensing Issues, (I'm already well aware of them). I'd like to know if it's possible to manage a Single Macro File on a Master Computer that several other computers can Simultaneously open/read/run this macro? Also, can the .MEX File be updated while it is also being accessed (IE. PC1 is running Macro1 and I use PC2 to update Macro2 at the same time. I'm sure if I tried to update Macro1 on PC2, that it would mess things up on PC1, so that would not be the issue. But the .MEX File would be accessible simultaneously).

 

I'm sure I can copy the Macro file to each computer, but when I start making changes to the individual macros, then I would have to make sure that all computers are updated and I would prefer to just manage the code in a single location.

 

Thank you in Advance for your responses.

 

Sincerely,

MGuyM

Link to comment
Share on other sites

The macro file can reside anywhere, including on a server. Multiple copies of Macro Express can access the same macro file as long as the 'File Locking of Macro Files' option is enabled.

 

When Macro Express starts it attempts to load all macros into a memory cache. As macros run Macro Express will load them from the memory cache. If all of the macros do not fit in memory then the most recently used macros will replace infrequently used macros in the cache. After starting, Macro Express does not access the macro file unless a macro needs to run that is not in the cache. In the situation you describe you could modify Macro2 on one computer and Macro Express on a second computer would not see the changes until it reloads the macros from the macro file.

 

The 'Automatic Synchronization Update' option allows a copy of Macro Express to periodically check the macro file to see if it has changed since it was last loaded into memory cache. You may, for example, set the 'Automatic Synchronization Update' to 'Synchronize Every 10 Minutes'. With this setting Macro Express would check the macro file every 10 minutes to see if a change has been made.

 

If you edit Macro1 on one computer it will not affect the second computer until the second computer tries to run Macro1.

 

These options are found in Options, Preferences, Network.

Link to comment
Share on other sites

Kevin,

 

Thank You So Much for the very detailed reply. You answered my dilema exactly. I now understand how to make things work from a single master File. Now I need to send you an EMail seperately to get the pricing to run ME on multiple computers in my home.

 

Thank You Again!

Link to comment
Share on other sites

I just thought I would say/add a few things:

 

1- Using a Macro file over the network rocks! I have been doing it for over a year in my office. I use variables extensively and the same macro can be doing several completely different things at the same time because the variables are saved locally on each user's machine.

 

2- I just noted the "synchronize every 10 minutes" thing. I looked in my preferences and sure enough, it was there, and set to 10. However, When I make a change to the networked master file with my machine, the changes are available to users instantly?

 

3- How big is the cache?

Link to comment
Share on other sites

1- Using a Macro file over the network rocks! I have been doing it for over a year in my office. I use variables extensively and the same macro can be doing several completely different things at the same time because the variables are saved locally on each user's machine.

I agree, this makes it wonderful to administrate ME3. I have not yet tried having the macro do different things based on locally stored variables, but that holds promise for us too.

Link to comment
Share on other sites

I have not yet tried having the macro do different things based on locally stored variables
I save all my user's vars and settings in the HKCU section of the registry and have found that works very well. But if you would like to save settings that are universal for all save it as an INI file right next to the Macro file on the network share. If you haven't messed with the INI file feature you need to as it is very slick.
When I make a change to the networked master file with my machine, the changes are available to users instantly?
Regardless of sync interval macro changes will be realized the next time a user runs the macro. Basically anytime you do anything it will read from the file and pick up the latest changes. The sync interval just means if you haven't done anything it will look to see if there are changes after that. Say, for instance, you changed the schedule of a macro. You haven't run the macro on the other machines so the change won't be realized but once the sync interval is up it will pick up the change.
Link to comment
Share on other sites

3- How big is the cache?
The cache defaults to 1024K (1 meg). This can be adjusted by clicking Options, Preferences, Caching.

 

Regardless of sync interval macro changes will be realized the next time a user runs the macro. Basically anytime you do anything it will read from the file and pick up the latest changes.
Cory, is this really true? Did you observe this? This is not what I expect. What is supposed to happen is the macro should be read from the cache unless the macro is not found in the cache. And then periodically the synchronization updates the macros in the cache.

 

Changes are not necessarily recognized 10 minutes after the macro file is edited. It can be up to 10 minutes. If you save when the synchronization timer is at 9 minutes 55 seconds it will seem that the macro is updated instantaneously. But if you save a moment after the synchronization occurred, it will be another 10 minutes before the change is recognized. (Assuming the Synchronize time is set to 10 minutes.)

 

Or maybe it is working differently than I expect.

Link to comment
Share on other sites

Changes are not necessarily recognized 10 minutes after the macro file is edited. It can be up to 10 minutes. If you save when the synchronization timer is at 9 minutes 55 seconds it will seem that the macro is updated instantaneously. But if you save a moment after the synchronization occurred, it will be another 10 minutes before the change is recognized. (Assuming the Synchronize time is set to 10 minutes.)

 

Or maybe it is working differently than I expect.

 

What Cory said.

 

I make progam fixes to the master file on the fly quite often and the fixes are executed by other users just as soon as I hit CNTL-S.

Link to comment
Share on other sites

Mmmmm... yeah. It's been some time but I remember we went round and round on this a while back when you were educating me on how the various options work and I remember doing some testing which backed this up. I had a macro that fired every minute and was making live changes in it that was instantly apparent to several machines. I suppose a test would be easy to rig. Wait a minute.... Was this when we were having caching issues? Perhaps I'm getting confused and this happened when I had that disabled...

Link to comment
Share on other sites

OK, did a simple test with a one line macro and I was wrong. If a change is made it will not be realized until the sync period has expired. However when the cache is disabled all changes are immediate.

 

Kevin, how could I be so wrong? My two thoughts were

  1. I was smoking crack.
  2. I had the cache disabled for other reasons and didn't realize it.
  3. The macro was bigger than the cache.

The macro I was experimenting with at the time was pretty large. Is it possible it was larger than the cache setting necessitating it be reread each time it ran?

 

Just when I think I got this thing figured out...

Link to comment
Share on other sites

I just had another thought. How are you determining that the macro has been updated, by the way it runs or how it looks in the Editor? The Script Editor does not edit the cache, it edits the file directly. If you are loading the Editor then the macro will be updated.

Link to comment
Share on other sites

In my case I made a test macro with a dialog box set initially to display one thing then another.

 

Kevin: If the macro is larger than the cache would it read the macro every time from file?

Link to comment
Share on other sites

Ah, that's where I went afoul. Learn something new everyday, thanks. Just goes to show that even empirical testing doesn't tell the whole story.

 

How would one determine the size of a macro? If I copy the commands (direct editor) and count the bytes is that the determining factor? And how are multiple macros managed, FIFO or by some other means? I'm guessing it could cache more than one.

Link to comment
Share on other sites

How would one determine the size of a macro?
You could export it to separate macro file or an .mxe file (playable macro) to get an estimate of it's size. The separate macro file would include the built-in system macros so the .mxe might be a closer estimate.

 

If I copy the commands (direct editor) and count the bytes is that the determining factor?
That would be another way to estimate the size. But, since each macro contains additional data in addition to the actual script commands, this method would only be an estimate.

 

And how are multiple macros managed, FIFO or by some other means? I'm guessing it could cache more than one.
If a macro isn't found in the cache and the cache does not have room for it already then macros that haven't run for a while are removed from the cache until there is room for the new macro.

 

One way to manage this is to check the size of your macro file and make the cache at least that big. But, I wouldn't worry about it unless I was seeing some performance issue. The cache management is quite quick and most don't notice that macros are being swapped in and out of the cache.

Link to comment
Share on other sites

How large is your macro file and how large is your cache?

 

Hi Kevin, sorry for the late reply.

 

Entire macro file (150 items)=421kb, cache=default (1024)

 

I am determining the cached file's state by how it executes the updated commands on other machines. I make an edit in the editor on my machine, and the machine across the room runs the updated file via hotkey right away.

Link to comment
Share on other sites

Hi all,

 

I need some help with a potential dilema I've been trying to sort out. I have about 2 Dozen different Macros that I run on a single PC. I'm considering setting them up to run on multiple computers in my Network because the work load is becoming too great for just one PC to handle. Without addressing the Licensing Issues, (I'm already well aware of them). I'd like to know if it's possible to manage a Single Macro File on a Master Computer that several other computers can Simultaneously open/read/run this macro? Also, can the .MEX File be updated while it is also being accessed (IE. PC1 is running Macro1 and I use PC2 to update Macro2 at the same time. I'm sure if I tried to update Macro1 on PC2, that it would mess things up on PC1, so that would not be the issue. But the .MEX File would be accessible simultaneously).

 

I'm sure I can copy the Macro file to each computer, but when I start making changes to the individual macros, then I would have to make sure that all computers are updated and I would prefer to just manage the code in a single location.

 

Thank you in Advance for your responses.

 

Sincerely,

MGuyM

 

Another solution you might consider is instead of having 1 .MEX file on your network, to instead save your individual macros into text files. In your case, you would have 12 text files saved to your network drive. The contents of each text file would be a single macro. Then, use macro express to copy these text files to the local machines and then load them as macros from a text file.

 

Now, to be a little more clear and to make this solution work, you need to do a couple more things.

 

First, I recommend using a scheduled macro that runs at least once a day on each local machine. This macro essentially checks the timestamp of the network text files against a local copy of the same text files. If the network time stamp of a particular text file is newer than a local copy, than this scheduled macro will copy that particular macro to the local machine. We use several hundred macros in this manner, and the scheduled macro almost instantly updates the local machine with new versions. It's very fast.

 

(In regards to the local machines, I personally save the macro text file at %userprofile%/macros/ on each machine where %userprofile% is a windows environment variable for "c:\document and settings\<nt login name>".)

 

Now that each local machine is being updated at least once a day, we need to take this further to ensure that each macro on the local machines get updated the moment there is a newer version of a macro. This second step involves adding code at the beginning of each macro that checks if the network text file is newer than the local machine. If the network contains a newer version, then you would have the macro copy that version to the local machine and then have code re-run the macro. The end effect is that macro gets updated instantly, and the macro runs the newest version.

 

Yes, I would love a Macro Express t-shirt for this macro solution! :) hah.

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...