Text this: Modelling and Implementation of Supervisory Control Systems Using State Machines with Outputs