An Erlang/OTP framework for automation and control