Have Python source code in Unix that runs automatically from rc.local at startup which continually
- monitors several Analog and Digital inputs
- displays any changes based on these inputs
Looking to make a rudimentary external CLI interface that would provide virtual inputs in parallel with the existing inputs
Basically using a Unix Shell Scripts I am wanting to do something like:
Not sure if there is any way to interact and or interchange data directly with a running program due to scoping and OS protections
The simplest way would be to just change a text file and have the main program read the values looking for any changes ... windows internally uses messaging to pass in and out data to/from other running processes ... briefly looked over Threading in Python and wondering if it might have some mechanism that might provide some way to interchange/share data?
Basically I am expecting the Main Process needs to have a TRUE set of Global/Shared variables such that both the running and an external program can affect the values
The Main logic would then monitor both the real input and the virtual input and update the display for the input that changed
Thoughts?
- monitors several Analog and Digital inputs
- displays any changes based on these inputs
Looking to make a rudimentary external CLI interface that would provide virtual inputs in parallel with the existing inputs
Basically using a Unix Shell Scripts I am wanting to do something like:
Code:
Description Shell Script Python
read current value of Input 1 Digital 1 get current value of Digital 1
override current value of Input 1 Digital 1 On override Digital 1 Value
override current value of Input 1 Digital 1 Off override Digital 1 Value
read current value of Input A Analog A get current value of Analog A
override current value of Input A Analog A 100 override current value of Analog A
override current value of Input A Analog A 0 override current value of Analog A
Not sure if there is any way to interact and or interchange data directly with a running program due to scoping and OS protections
The simplest way would be to just change a text file and have the main program read the values looking for any changes ... windows internally uses messaging to pass in and out data to/from other running processes ... briefly looked over Threading in Python and wondering if it might have some mechanism that might provide some way to interchange/share data?
Basically I am expecting the Main Process needs to have a TRUE set of Global/Shared variables such that both the running and an external program can affect the values
The Main logic would then monitor both the real input and the virtual input and update the display for the input that changed
Thoughts?