Note that there are some explanatory texts on larger screens.

plurals
  1. POCommunication between two applications using Environment Variables
    primarykey
    data
    text
    <h2>Question</h2> <p>How to communicate with another program (for instance, a windows service one) through environment variables (not system or user ones)?</p> <h2>What do we have</h2> <p>Well, I have the following scheme for a data logger:</p> <pre><code>------------------------- -------------------------------- | the things to measure | | the things that do something | ------------------------- -------------------------------- | ^ | sensors | switches V | ------------------------------------------------------------------- | dedicated hardware | ------------------------------------------------------------------- | ^ | | serial communication V | --------------- ------------- | Windows | ------------------------------------&gt; | user | | service | &lt;------------------------------------ | interface | --------------- udp communication ------------- |^ keyboard V| and screen -------- | user | -------- </code></pre> <p>On current development:</p> <ul> <li>windows service is always running when Windows is running</li> <li>user can open and close user interface (of course :p)</li> <li>windows service acquires data from sensors</li> <li>user interface automatic requests data to windows service every 100ms and shows it to user via udp communication through some implemented protocol (we call it <code>GetData()</code> command and response to it)</li> <li>user can send some other commands to change the data to acquire through implemented protocol (we call it <code>SetSensors()</code> command and response to it)</li> </ul> <p>Both user interface and windows service are developed on Borland C+ Builder 6 and use NMUDP component, from FastNet tab, for UDP communication.</p> <h2>What we are thinking to do</h2> <p>Because of some buffer issues and to free udp channel only for sending <code>SetSensors()</code>command and response to it, we are considering that instead of using <code>GetData()</code>:</p> <ul> <li>Windows service would get data from sensors and put them on environment variables</li> <li>the user interface would read them to show to user</li> </ul> <h2>Scheme after doing what we are thinking</h2> <pre><code>------------------------- -------------------------------- | the things to measure | | the things that do something | ------------------------- -------------------------------- | ^ | sensors | switches V | ------------------------------------------------------------------- | dedicated hardware | ------------------------------------------------------------------- | ^ | | serial communication V | --------------- ------------- | | ------------------------------------&gt; | | | | environment variables | | | | (get data from sensors) | | | Windows | | user | | service | | interface | | | | | | | ------------------------------------&gt; | | | | &lt;------------------------------------ | | --------------- udp communication ------------- (send commands to service) |^ keyboard V| and screen -------- | user | -------- </code></pre> <h2>Any way to do that?</h2> <p>We would not use system and user environment variables, because it writes on Windows Registry, i.e., it will save to hard drive and it gets more slow...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload