Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mos:using_the_modular_output_system [2024/09/18 01:10] optrix created |
mos:using_the_modular_output_system [2024/09/18 01:39] (current) optrix |
||
---|---|---|---|
Line 1: | Line 1: | ||
====Using the Modular Output System==== | ====Using the Modular Output System==== | ||
- | If you'd like to use the Modular Output System in your own projects, the system is relatively easy to use. | + | If you'd like to use the [[mos: |
===Include the Library=== | ===Include the Library=== | ||
- | <script | + | <code python> |
import ardi.util.outputengine as outie | import ardi.util.outputengine as outie | ||
- | </script> | + | |
+ | </code> | ||
===Create and Start an Instance=== | ===Create and Start an Instance=== | ||
- | <script | + | <code python> |
oe = outie.OutputEngine(" | oe = outie.OutputEngine(" | ||
oe.Start() | oe.Start() | ||
- | </script> | + | </code> |
This creates an instance of the Output Engine. You pass a name that identifies your application. | This creates an instance of the Output Engine. You pass a name that identifies your application. | ||
- | Calling | + | |
+ | Note that calling | ||
===Writing Key/Value Pairs=== | ===Writing Key/Value Pairs=== | ||
If you want to write numeric, status or other key-value data, you use the [[WriteValue|WriteValue]] function of the OutputEngine object. | If you want to write numeric, status or other key-value data, you use the [[WriteValue|WriteValue]] function of the OutputEngine object. | ||
+ | |||
+ | <code python> | ||
+ | oe.WriteValue(' | ||
+ | </ | ||
To record an event, use [[WriteLog|WriteLog]]. | To record an event, use [[WriteLog|WriteLog]]. | ||
+ | <code python> | ||
+ | oe.WriteLog(' | ||
+ | </ | ||
+ | |||
+ | ===Closing=== | ||
+ | |||
+ | When finished, you should call ' | ||
+ | |||
+ | <code python> | ||
+ | oe.Stop() | ||
+ | </ | ||
+ | This will stop any HTTP, Modbus/TCP, OPC-UA or other services that were brought up by the Modular Output System. |