Network communications

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Krep
Junior Coder
Posts: 31
Joined: Thu Nov 12, 2009 3:56 pm

Network communications

Post by Krep » Thu May 10, 2018 10:08 pm

Hello,

I have two computers on a LAN both running Macro Scheduler scripts. In the past, when I've needed to communicate from one script to the other, I shared a folder and just read/write files inside the folder from each computer across the LAN... But this can be a little clunky and slow and I have to be careful not to have both scripts try to read the file before or while the other is writing and cause a "can't write" or "can't read" error on the other computer. It also means I have to constantly scan to see if the file has been written, and I think previously I created a "flag" file so that I can check if it exists prior to reading the data file, just so I can ensure I'm not reading it before it's done being written. I don't think Macroscheduler supports the file sharing options like "open for Random access" or "open exclusive", etc. Is there a better way to share data across the LAN? With a DLL or perhaps something native to Macro Scheduler?

-Krep

Krep
Junior Coder
Posts: 31
Joined: Thu Nov 12, 2009 3:56 pm

Re: Network communications

Post by Krep » Thu May 10, 2018 10:09 pm

Or via a VBScript command?

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Network communications

Post by Marcus Tettmar » Fri May 11, 2018 10:50 am

Not sure what info you are wanting to move back and forth but a database might be more suitable. Could just be Access, but could also be SQL Server or similar. Use the database functions.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Krep
Junior Coder
Posts: 31
Joined: Thu Nov 12, 2009 3:56 pm

Re: Network communications

Post by Krep » Fri May 11, 2018 1:30 pm

Realtime rapid control, X, Y, Z coordinates in variables from computer A to variables in computer B. Updated very fast (ms).

So, I guess it's either stick with file I/O or load a library with some kind of networking support...

-Krep

Krep
Junior Coder
Posts: 31
Joined: Thu Nov 12, 2009 3:56 pm

Re: Network communications

Post by Krep » Fri May 11, 2018 1:50 pm

Maybe include the Ws2_32.dll library and use Sockets?

Such as:
https://msdn.microsoft.com/en-us/librar ... s.85).aspx

https://msdn.microsoft.com/en-us/librar ... s.85).aspx

Would this be super difficult? Maybe I should try standing up a file I/O based share first, and test if it's fast enough...

-Krep

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Network communications

Post by Marcus Tettmar » Mon May 14, 2018 1:53 pm

Yes you could use a networking protocol. Probably would have to use a COM interface with VBScript.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts