Mega and Scada?

Would it be complicated to re-program the sketch to Arduino?

Maybe, maybe not. That's why I was asking what your requirements are. Reading and writing all digital pins and reading all analog pins would enable you to do what you describe.

It looks like Scada can make the necessary requests. Whether the Arduino sketch can be modified to satisfy all the requests, or not, is the issue.

I'll look into it.