Alerting my other software


Recommended Posts


Yes, I am back again lol. This time, I want to setup an analog input port. This is pretty easy to do.

Now, with the value that I am getting from the input port, I want to alert my other software running on the computer for it to start doing things based on what was sent through that port.

The easiest way to do this I think is to just set a file-based database which is updated after every readings. Then my other software would also read this file every now and then, to check the values and act accordingly.

Do you guys have a better idea or recommendations? Would there be a way to directly alert my other software?


Link to comment
Share on other sites

Using a file is probably the most likely way to get this to work. There are other options, but it really depends on the capabilities of your other software. For example, you can get live data into Excel and many other apps using DDE.

With the file method, you are going to have to use the file. functions to achieve this and make sure to close() the file each time, otherwise your other app may not be able to open it. The logging and export sets tend to hold the files open for efficiency and so are not the best choice for this.

Finally, realize that using a file as a pass through does not offer any sort of synchronization. If you are not careful, it is pretty easy to have values partially read in. My recommendation is to put a header and footer of a few characters. Then your other application can test for both the header and footer and only if both exist would it assume the data is complete.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.