Today, while I was watching somebody fiddle with a DCS it occurred to me that OpenDAX is missing a pretty handy feature. There is no way to force values. These forces would override whatever the other modules would be writing to those tags. I doubt that I get started on it in the very near future but I wanted to spend some time here putting down my thoughts before I forget.
It'd be easy to write some code that would check a bit mask for forces and then ignore writes to that tag after the forced value has been written there. Then when the force is removed the tag value would remain the forced value until some module overwrote it. I don't really like this idea.
I think the normal tag writing mechanism should proceed unhindered, and take care of forces on the read side of the server. There would be some kind of bit map for the tags that had forces and then some kind of linked list or other data structure to hold the forced values. When the server went to read the data it could determine if a value was forced by checking the bit mask for tag and then searching the data structure for the data. It'd be much easier if the data was the whole tag and the forces were determined by two data areas, a force mask and the forced values themselves. This would take up a lot of memory but forces are not something that would be part of normal operation and should not be left in.
The nice thing about this is that the force can be toggled between the real data (which would still be changing the way it normally would) and the forced value. The trick will be how to do it efficiently.
There would also need to be an indicator in the _status tag to show that there are forces enabled.