PROGRAM DeviceStatus

IF NOT Start_Permissive AND NOT cmd_Run THEN
	Device_Status := 'Not ready to start';
	Device_Status_INT := 2;
END_IF;


IF Device_Status = 'Not ready to start' AND Start_Permissive AND NOT cmd_Run THEN
	Device_Status := 'Ready to start';
	Device_Status_INT := 3;
END_IF;
END_PROGRAM