atk_nut Posted January 26, 2005 Report Share Posted January 26, 2005 Does anybody have any tips on implementing "hardware" sharing between two different systems running two different .exe's? What I'm looking for is a "semaphore" that will work between different pc's across a network and between different compiled .exe's. The end result is to inhibit a particular test that will interfere with another test that is running at the same time. Thanks in advance! Quote Link to comment
Ale914 Posted March 15, 2005 Report Share Posted March 15, 2005 In not EXE application you can use LV syncronization utility to syncronize two or more application in a network calling the same .llb, for ex queue or semaphore, form all applications... but in EXE you can't do this. In this cases i implement a custom network protocol for share varius information and therefore syncronization data between different applications. The next LV version would implement functionality to develop network distributed applications... it could resolve your problems Bye, Alessandro. Quote Link to comment
Louis Manfredi Posted March 15, 2005 Report Share Posted March 15, 2005 Hi Ale914: There must be an easier, and more elegant way to do this, but, if worst comes to worst, and if both systems can read and write to a common directory location, you can use a small dummy file as a semaphore. When application #1 wants to grab the hardware, it first opens the dummy file for edits and prohibits access by other applications. Application #2 then would get a file error when it tried to open the dummy file, and would have to wait its turn, until App #1 released the hardware, and closed the dummy file. I know this is rather kludgey, but we used it a lot in the bad old days, and if no one suggests something more elegant, it will probably still work today. Hope to have been of help & Best Regards, Louis Quote Link to comment
aledain Posted March 18, 2005 Report Share Posted March 18, 2005 I would suggest making a third exe: a resource controller. This third exe publishes data to a datasocket server (on itself or another machine). The client exe's check the tags the datasocker server for whether the resource is "in use". Bet this app could be written in under 5 minutes Quote Link to comment
atk_nut Posted March 18, 2005 Author Report Share Posted March 18, 2005 Here's how I solved it: Since both apps were accessing a SQL server DB. I just created a small table in that database to "token" pass between the two apps. I decided to go this way, because we could potentially have half a dozen machines accessing the hardware in the future. I would prefer direct communication because SQL may not always be available, but it works quite well for now. Thanks. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.