Jump to content

How to synchronize 2 pcs ?


Recommended Posts

I have 2 apps which run on 2 pcs - the app itself & the tester process.

They communicate over the serial port, but I want to synchronize their user interfaces, so that they are in synch.

Is there a standard AutoIt way of doing this?

Thanks in advance.

Link to comment
Share on other sites

@hour @min @day etc..

You can get this information and have them proform functions at specific times.

annother option is to send a command to your other computer to say "ok start" and as soon as it see's it, it will continue on with it's script.

For my program I have it using "fileexists" to wait for a file to show up and start performing tasks. So basically one program sends the file and as soon as it shows up the other starts doing what it's been told to do.

not sure if that helps

Link to comment
Share on other sites

Well, I didn't want to give away my solution until I heard what others did, just to spur some thought processes :-)

I can't use time synch, since I really need repeated handshakes - I can not predict how long it will take each machine to perform his tasks.

FileExists sounds ok. At first blush, I don't like the look of it, because you are probably in a tight loop, calling Sleep() then FileExists () repeatedly. But, I am sure that any other solutions, like mine, which call WaitWaindowActive() have a Sleep() loop at the bottom of them, when you look into the AutoIt source.

I decided to use the Windows Messenger Service, to have the two PCs send each other commands & acknowledgements. I have written a bunch of functions for this which I will post if not one come up with a more elegant solution.

Thanks for the feedback.

Link to comment
Share on other sites

yeah, windows messenger is an interesting idea. I can't do it that way since I want it to appear hidden. So I have my INI file being saved to a hidden folder with it's various functions in it. I don't want the students knowing and seeing how it works. MAny of them won't be computer savy enough to do anything about it even if they did see.. but some will and I'd rather they not.

I get a very quick response time on the file. It's nearly instant. if you used an empty folder and just used the name of the file as your command it would be more invisible and should be just as fast. You could read the file with a wild card.. I think you can do that anyway.

Something like

$var = fileexists(*.ini)

if $var = notepad.ini then

run ("notepad.exe")

endif

you could use cases instead for a list of commands so that it could perform the specific function you wanted. However, your method is fine.. so unless you want it to be more invisible.. then go with that.

Very clever idea. :D

Perhaps in a future version of Autoit we well be able to send a command to an open channel on a network and have them respond that way...

moo

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...