Log point values only when "told" to do so...
-
This may seem evident, but trying to figure out a way to log datapoints ONLY while an external process is running - perhaps by triggering an event in some watchdog point - or by scripting of some sort. Idea is, a process runs for, say, 3 hours per day; for a variety of reasons (charting being one of them), several points are logged at second or even sub-second intervals but don't want them logged when the external process is idle. Communication is via modbus, primarily TCP.
Perhaps its possible to prevent (or enable, for that matter) modbus reads depending on a datapoint state.
Any thoughts appreciated!
-
Hi @bullitbd
The following functions are available in the scripting enviroment. So you could use a meta point to watch if your process is running and then enable the relevant data source. then disable it when the process is not running. Data sources do take some time to start so you might need to look at how you could get a signal before the process starts.
isDataSourceEnabled(xid)
xid - Xid for a data source return true if enabled false if not or DNEenableDataSource(xid)
xid - Xid for a data source, return statusdisableDataSource(xid)
xid - Xid for a data source, return statusisDataPointEnabled(xid)
xid - Xid for a data point return true if enabled false if not or DNE or User does not have permissions -
perfect! Not sure how I missed About Mango Java Script - thank you!