PLC-based motion control architecture