LIGHTS MANAGEMENT

 (INTRO)

 

LANGUAGE
Karel
CREATED
2019-
MODIFIED
2019-

 

CODE

/PROG  BGLLIGHT
/ATTR
OWNER  = MNEDITOR;
COMMENT  = "Gestion Lumières";
PROG_SIZE = 1986;
CREATE  = DATE 16-04-14  TIME 10:30:18;
MODIFIED = DATE 19-11-21  TIME 11:34:06;
FILE_NAME = ;
VERSION  = 0;
LINE_COUNT = 61;
MEMORY_SIZE = 2242;
PROTECT  = READ_WRITE;
TCD:  STACK_SIZE = 0,
      TASK_PRIORITY = 50,
      TIME_SLICE = 0,
      BUSY_LAMP_OFF = 0,
      ABORT_REQUEST = 0,
      PAUSE_REQUEST = 0;
DEFAULT_GROUP = *,*,*,*,*;
CONTROL_CODE = 00000000 00000000;
/MN
   1:  --eg:Copyright (c) 2019 DIY-Robotics.com All rights reserved. ;
   2:  --eg: ;
   3:  --eg:Redistribution and use in source and binary forms, with or without ;
   4:  --eg:modification, are permitted provided that the following conditions
    :  are ;
   5:  --eg:met: ;
   6:  --eg: ;
   7:  --eg:Redistributions of source code must retain the above copyright ;
   8:  --eg:notice, this list of conditions and the following disclaimer. ;
   9:  --eg:Redistributions in binary form must reproduce the above ;
  10:  --eg:copyright notice, this list of conditions and the following
    :  disclaimer ;
  11:  --eg:in the documentation and/or other materials provided with the ;
  12:  --eg:distribution. ;
  13:  --eg:Neither the name of DIY-Robotics.com nor the names of its ;
  14:  --eg:contributors may be used to endorse or promote products derived from ;
  15:  --eg:this software without specific prior written permission. ;
  16:  --eg: ;
  17:  --eg:Tour Lumineuse Orange ;
  18:   ;
  19:  --eg:Tour Lumineuse Verte ;
  20:  IF (!UO[3:Prg running]),DO[9:TLGreen]=(OFF) ;
  21:  IF (UO[3:Prg running]),DO[9:TLGreen]=(ON) ;
  22:   ;
  23:  --eg:Tour Lumineuse Rouge ;
  24:  IF (!SO[3:Fault LED]),DO[7:TLRed]=(OFF) ;
  25:  IF (SO[3:Fault LED]),DO[7:TLRed]=(ON) ;
  26:   ;
  27:  --eg:Tour Lumineuse Alarme Sonore ;
  28:  IF (F[30:CellAlarm] AND !F[12:SilenceBuzzer]) THEN ;
  29:  DO[6:TLBuzzer]=(F[9:Pulse0.25s]) ;
  30:  ELSE ;
  31:  DO[6:TLBuzzer]=OFF ;
  32:  ENDIF ;
  33:   ;
  34:   ;
  35:  --eg:Bouton Reset Lumiere blue ;
  36:  IF (DO[511:CtrlAutoMode] AND !UO[8:TP enabled] AND DI[5:EStopOK] AND DI[6:FenceOK]) THEN ;
  37:  IF (UO[6:Fault] OR F[30:CellAlarm]) THEN ;
  38:  DO[4:ResetBtnLight]=(F[8:Pulse0.5s]) ;
  39:  ELSE ;
  40:  DO[4:ResetBtnLight]=(ON) ;
  41:  ENDIF ;
  42:  ELSE ;
  43:  DO[4:ResetBtnLight]=OFF ;
  44:  ENDIF ;
  45:   ;
  46:   ;
  47:  --eg:Bouton Demarrer Lumiere Verte ;
  48:  IF (UO[3:Prg running]=ON AND UO[2:System ready]=ON),DO[3:StartBtnLight]=(ON) ;
  49:  IF (UO[3:Prg running]=OFF AND UO[2:System ready]=ON AND !SO[3:Fault LED] AND !F[30:CellAlarm] AND DO[511:CtrlAutoMode] AND !UO[8:TP enabled]),DO[3:StartBtnLight]=(F[8:Pulse0.5s]) ;
  50:  IF (UO[2:System ready]=OFF),DO[3:StartBtnLight]=(OFF) ;
  51:   ;
  52:   ;
  53:  --eg:Bouton Rearmement Lumiere Jaune ;
  54:  IF (DI[6:FenceOK]=ON),DO[2:LockBtnLight]=(ON) ;
  55:  IF (DI[6:FenceOK]=OFF),DO[2:LockBtnLight]=(F[8:Pulse0.5s]) ;
  56:   ;
  57:  !Bouton Stop Lumiere Rouge ;
  58:  IF (F[14:StopProdReq]) THEN ;
  59:  DO[5:StopBtnLight]=(F[8:Pulse0.5s]) ;
  60:  ENDIF ;
  61:  IF (!F[14:StopProdReq]),DO[5:StopBtnLight]=(OFF) ;
/POS
/END

 

mceclip0.png

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.