STANDARD LOGIC

 (INTRO)

 

LANGUAGE
Karel
CREATED
2019-10-15 
MODIFIED
2019-11-21

 

CODE  mceclip0.png

/PROG  BGLOGIC1
/ATTR
OWNER  = MNEDITOR;
COMMENT  = "StandardLogic";
PROG_SIZE = 2679;
CREATE  = DATE 19-10-15  TIME 12:57:46;
MODIFIED = DATE 19-11-21  TIME 11:34:16;
FILE_NAME = BGLOGIC1;
VERSION  = 0;
LINE_COUNT = 73;
MEMORY_SIZE = 3079;
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;
/APPL


AUTO_SINGULARITY_HEADER;
  ENABLE_SINGULARITY_AVOIDANCE   : TRUE;
/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:  !Stop Production ;
  18:  IF (DI[4:StopBtn] AND UO[3:Prg running]),F[14:StopProdReq]=(ON) ;
  19:  IF (!UO[3:Prg running] AND !UO[4:Prg paused]),F[14:StopProdReq]=(OFF) ;
  20:   ;
  21:  !STATUS FLAG ;
  22:  F[10:MemTeachOff]=(SO[7:TP enabled]) ;
  23:  F[5:ModeStepEnbl]=($SSR.$SingleStep) ;
  24:  IF (!UO[3:Prg running] AND !UO[4:Prg paused]) THEN ;
  25:  F[11:RobotAborted]=(ON) ;
  26:  ELSE ;
  27:  F[11:RobotAborted]=(OFF) ;
  28:  ENDIF ;
  29:  F[90:UnlockProdChange]=(!UO[3:Prg running] AND UO[7:At perch]) ;
  30:   ;
  31:  --eg:Reset des flags ;
  32:  IF (F[1024:UIStart]),F[1024:UIStart]=PULSE,0.5sec ;
  33:  IF (F[1023:UIReset] AND !DI[3:ResetBtn]),F[1023:UIReset]=PULSE,0.5sec ;
  34:  IF (F[1022:UIStop]),F[1022:UIStop]=PULSE,0.5sec ;
  35:   ;
  36:  --eg:Calcul des flags de pulse ;
  37:  IF (TIMER[19]>.5) THEN ;
  38:  F[8:Pulse0.5s]=(!F[8:Pulse0.5s]) ;
  39:  $TIMER[19].$TIMER_VAL=0 ;
  40:  ENDIF ;
  41:  IF (TIMER[19]>.25) THEN ;
  42:  F[9:Pulse0.25s]=(ON) ;
  43:  ELSE ;
  44:  F[9:Pulse0.25s]=(OFF) ;
  45:  ENDIF ;
  46:   ;
  47:  --eg:Ajustement des variables de vitesse pour les macros ;
  48:  IF (SO[7:TP enabled]),$SCR.$RUNOVLIM=(50) ;
  49:  IF (!SO[7:TP enabled]),$SCR.$RUNOVLIM=(100) ;
  50:   ;
  51:  --eg:Declaration du flag de Space Check pour la Machine1 ;
  52:  F[3:SpaceChk1Enb]=($RSPACE1[1].$ENABLED) ;
  53:  --eg:Declaration du flag de Space Check pour la Machine2 ;
  54:  F[4:SpaceChk2Enb]=($RSPACE1[2].$ENABLED) ;
  55:   ;
  56:  --eg:=== EUROMAP 67 === ;
  57:  --eg:=== MACHINE 1 === ;
  58:  IF (DI[214:PressInAuto] AND DI[209:MoldOpen] AND F[1:NewPartMachine1]),DO[210:EnbMoldClose]=(OFF) ;
  59:  IF (DI[214:PressInAuto] AND DI[215:MoldClosed]),DO[212:EnbEjectorBack]=(OFF) ;
  60:  IF (DI[214:PressInAuto] AND DI[215:MoldClosed]),DO[213:EnbEjectorFwd]=(OFF) ;
  61:  IF (DI[214:PressInAuto] AND DI[215:MoldClosed] AND !DI[209:MoldOpen]),F[1:NewPartMachine1]=(ON) ;
  62:  IF (UO[7:At perch] AND DO[209:MoldAreaFree] AND !UO[3:Prg running] AND !DO[511:CtrlAutoMode]),F[1:NewPartMachine1]=(OFF) ;
  63:   ;
  64:  IF (UO[7:At perch] AND DO[209:MoldAreaFree] AND !UO[3:Prg running] AND !DO[511:CtrlAutoMode]),DO[210:EnbMoldClose]=(ON) ;
  65:  IF (UO[7:At perch] AND DO[209:MoldAreaFree] AND !UO[3:Prg running] AND !DO[511:CtrlAutoMode]),DO[212:EnbEjectorBack]=(ON) ;
  66:  IF (UO[7:At perch] AND DO[209:MoldAreaFree] AND !UO[3:Prg running] AND !DO[511:CtrlAutoMode]),DO[213:EnbEjectorFwd]=(ON) ;
  67:  IF (UO[7:At perch] AND DO[209:MoldAreaFree] AND !UO[3:Prg running] AND !DO[511:CtrlAutoMode]),DO[214:CorePull1Pos1]=(ON) ;
  68:  IF (UO[7:At perch] AND DO[209:MoldAreaFree] AND !UO[3:Prg running] AND !DO[511:CtrlAutoMode]),DO[215:CorePull1Pos2]=(ON) ;
  69:  IF (UO[7:At perch] AND DO[209:MoldAreaFree] AND !UO[3:Prg running] AND !DO[511:CtrlAutoMode]),DO[216:CorePull2Pos1]=(ON) ;
  70:  IF (UO[7:At perch] AND DO[209:MoldAreaFree] AND !UO[3:Prg running] AND !DO[511:CtrlAutoMode]),DO[217:CorePull2Pos2]=(ON) ;
  71:   ;
  72:  !Sample Respect ;
  73:  IF (DI[3:ResetBtn] AND !DI[209:MoldOpen] AND UO[3:Prg running]),F[15:SampleRequest]=(ON) ;
/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.