window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date());gtag('config', 'UA-141884085-1'); gtag('config', 'AW-761820283');

Programming templates

PROGRAMMATION TEMPLATE ZERO

PROGRAMMATION TEMPLATE ZERO

LANGUAGE: Karel

CREATED: 2019

MODIFIED: 2019

CODE   
tag icon

/PROG  ZERO
/ATTR
OWNER  = MNEDITOR;
COMMENT  = "";
PROG_SIZE = 1481;
CREATE  = DATE 19-08-29  TIME 08:52:32;
MODIFIED = DATE 19-11-21  TIME 11:37:10;
FILE_NAME = ;
VERSION  = 0;
LINE_COUNT = 19;
MEMORY_SIZE = 1777;
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 = 1,*,*,*,*;
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:J P[1] 100% FINE    ;
18:J P[2:j1 90deg] 100% FINE    ;
19:J P[3:j2j3 45deg] 100% FINE    ;
/POS
P[1];
P[2:"j1 90deg"];
P[3:"j2j3 45deg"];
/END

Mch2 Interlock Off

Mch2 Interlock Off

LANGUAGE: Karel

CREATED: 2019-07-08

MODIFIED: 2019-11-21

CODE   
tag icon

/PROG  INTLK_OFF_MCH2
/ATTR
OWNER  = MNEDITOR;
COMMENT  = “Mch2 Interlock”;
PROG_SIZE = 1347;
CREATE  = DATE 19-07-08  TIME 22:14:20;
MODIFIED = DATE 19-11-21  TIME 11:34:44;
FILE_NAME = INTLK_OF;
VERSION  = 0;
LINE_COUNT = 25;
MEMORY_SIZE = 1619;
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:  !THIS PART OF THE PROGRAM ;
18:  !ENABLE THE CYCLE OF THE ;
19:  !MACHINE. DO NOT CHANGE ;
20:  !UNLESS YOU HAVE A GOOD ;
21:  !UNDERSTANDING OF THE PROGRAM ;
22:   ;
23:  !ENBL MACHINE CLOSE, CLAMP ;
24:  DO[226]=ON ;
25:  DO[229]=ON ;
/POS
/END

PRG_EXIST.kl

PRG_EXIST.kl

This Karel program valid if a specific program name already exists in the robot.

CODE   
tag icon

PROGRAM PRG_EXIST

%NOPAUSE=ERROR+COMMAND+TPENABLE
%NOBUSYLAMP
%NOLOCKGROUP
%NOPAUSESHFT

CONST
flg_id = 1– Flag number that will be set when the program exist
str_reg_id =1– String Register number to compare

VAR
ary_name: ARRAY[200] OF STRING[64] new_tp_name: STRING[64] n_progs: INTEGER
i,status: INTEGER

BEGIN
–Reset Flag
FLG[flg_id] = FALSE

— Get String Register Value
GET_STR_REG(str_reg_id,new_tp_name,status)
— Get the list of all TP program
PROG_LIST(‘*’,7,0,1,ary_name,n_progs,status)

FOR i = 1 TO n_progs DO
— Set flag is the program already exist
IF (ary_name[i] = new_tp_name) THEN FLG[flg_id]=TRUE; ENDIF
ENDFOR

END PRG_EXIST

YesNoPopup.kl

YesNoPopup.kl

Here’s an example of a program that shows a popup “Yes or No” in the teach pendant.

CODE   
tag icon

PROGRAM YesNoPopup
%NOPAUSE=ERROR+COMMAND+TPENABLE
%NOBUSYLAMP
%NOLOCKGROUP
%ENVIRONMENT uif
%INCLUDE klevkmsk

CONST
— Text to display in popup
messageStr = ‘Yes or no?’ — Message
btn1Str = ‘No’ — First button
btn2Str = ‘Yes’ — Second button

— Type of data to set
DataType = ’35’ — 35 is Flag
DataIndex = ‘1’ — Flag number

— Name of HTM page
popupFileName = ‘MD:POPUP.HTM’

VAR
popupFile: FILE
term_char: INTEGER
status: INTEGER

BEGIN

— Create a HTM file with Text Zone and 2 buttons
OPEN FILE popupFile (‘RW’, popupFileName)
WRITE popupFile(‘<DIALOG posx=”150″ posy=”150″ width=”360″ height=”180″ bgcolor=”#3A3B3B” >’)
WRITE popupFile(‘<DLGTILE posx=”10″ posy=”10″ width=”340″ height=”75″>’)
WRITE popupFile(‘<object classid=”clsid:7106065C-0E45-11D3-81B6-0000E206D650″ id=”LABEL1″>’)
WRITE popupFile(‘ <param name=”Caption” value=”‘+messageStr+'”>’)
WRITE popupFile(‘<param name=”DataType” value=”100″>’)
WRITE popupFile(‘<param name=”FontSize” value=”28″>’)
WRITE popupFile(‘ <param name=”ForeColor” value=”16777215″>’)
WRITE popupFile(‘ <param name=”Border” value=”1″>’)
WRITE popupFile(‘</object>’)
WRITE popupFile(‘</DLGTILE>’)
WRITE popupFile(‘<DLGTILE posx=”20″ posy=”100″ width=”150″ height=”50″ type=”1″>’)
WRITE popupFile(‘<object classid=”clsid:7106066C-0E45-11D3-81B6-0000E206D650″ id=”TGBTN1″>’)
WRITE popupFile(‘<param name=”Caption” value=”‘+btn1Str+'”>’)
WRITE popupFile(‘ <param name=”DataType” value=”‘+DataType+'”>’)
WRITE popupFile(‘ <param name=”DataIndex” value=”‘+DataIndex+'”>’)
WRITE popupFile(‘ <param name=”SetValue” value=”-1″>’)
WRITE popupFile(‘ <param name=”FontSize” value=”28″>’)
WRITE popupFile(‘ <param name=”TrueColor” value=”1179878″>’)
WRITE popupFile(‘ <param name=”FalseColor” value=”1179878″>’)
WRITE popupFile(‘ <param name=”BackColor” value=”1179878″>’)
WRITE popupFile(‘ <param name=”Border” value=”2″>’)
WRITE popupFile(‘</object>’)
WRITE popupFile(‘</DLGTILE>’)
WRITE popupFile(‘<DLGTILE posx=”190″ posy=”100″ width=”150″ height=”50″ type=”1″>’)
WRITE popupFile(‘<object classid=”clsid:7106066C-0E45-11D3-81B6-0000E206D650″ id=”TGBTN1″>’)
WRITE popupFile(‘<param name=”Caption” value=”‘+btn2Str+'”>’)
WRITE popupFile(‘ <param name=”DataType” value=”‘+DataType+'”>’)
WRITE popupFile(‘ <param name=”DataIndex” value=”‘+DataIndex+'”>’)
WRITE popupFile(‘ <param name=”SetValue” value=”0″>’)
WRITE popupFile(‘ <param name=”FontSize” value=”28″>’)
WRITE popupFile(‘ <param name=”TrueColor” value=”170503″>’)
WRITE popupFile(‘ <param name=”FalseColor” value=”170503″>’)
WRITE popupFile(‘ <param name=”BackColor” value=”170503″>’)
WRITE popupFile(‘ <param name=”Border” value=”2″>’)
WRITE popupFile(‘</object>’)
WRITE popupFile(‘</DLGTILE>’)
WRITE popupFile(‘</DIALOG>’)
CLOSE FILE popupFile

— Display popup
DISCTRL_DIAG(popupFileName, kc_prev_key, term_char, status)

END YesNoPopup

Alarms Management

Alarms Management

LANGUAGE: Karel

CREATED: 2019-01-01

MODIFIED: 2019-01-01

CODE   
tag icon

/PROG  BGLALARMS
/ATTR
OWNER  = MNEDITOR;
COMMENT  = “Gestion Alarmes”;
PROG_SIZE = 2010;
CREATE  = DATE 19-11-21  TIME 11:25:58;
MODIFIED = DATE 19-11-21  TIME 11:33:28;
FILE_NAME = ;
VERSION  = 0;
LINE_COUNT = 85;
MEMORY_SIZE = 2298;
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:  !ALARMS RESET ;
18:  IF (DI[3:ResetBtn]=ON) THEN ;
19:  F[30:CellAlarm]=(OFF) ;
20:  F[31:UAlarm1]=(OFF) ;
21:  F[32:UAlarm2]=(OFF) ;
22:  F[33:UAlarm3]=(OFF) ;
23:  F[34:UAlarm4]=(OFF) ;
24:  F[35:UAlarm5]=(OFF) ;
25:  F[36:UAlarm6]=(OFF) ;
26:  F[37:UAlarm7]=(OFF) ;
27:  F[38:UAlarm8]=(OFF) ;
28:  F[39:UAlarm9]=(OFF) ;
29:  F[40:UAlarm10]=(OFF) ;
30:  ENDIF ;
31:   ;
32:  IF (F[31:UAlarm1]) THEN ;
33:  UALM[1] ;
34:  F[30:CellAlarm]=(ON) ;
35:  ENDIF ;
36:   ;
37:  IF (F[32:UAlarm2]) THEN ;
38:  UALM[2] ;
39:  F[30:CellAlarm]=(ON) ;
40:  ENDIF ;
41:   ;
42:  IF (F[33:UAlarm3]) THEN ;
43:  UALM[3] ;
44:  F[30:CellAlarm]=(ON) ;
45:  ENDIF ;
46:   ;
47:  IF (F[34:UAlarm4]) THEN ;
48:  UALM[4] ;
49:  F[30:CellAlarm]=(ON) ;
50:  ENDIF ;
51:   ;
52:  IF (F[35:UAlarm5]) THEN ;
53:  UALM[5] ;
54:  F[30:CellAlarm]=(ON) ;
55:  ENDIF ;
56:   ;
57:  IF (F[36:UAlarm6]) THEN ;
58:  UALM[6] ;
59:  F[30:CellAlarm]=(ON) ;
60:  ENDIF ;
61:   ;
62:  IF (F[37:UAlarm7]) THEN ;
63:  UALM[7] ;
64:  F[30:CellAlarm]=(ON) ;
65:  ENDIF ;
66:   ;
67:  IF (F[38:UAlarm8]) THEN ;
68:  UALM[8] ;
69:  F[30:CellAlarm]=(ON) ;
70:  ENDIF ;
71:   ;
72:  IF (F[39:UAlarm9]) THEN ;
73:  UALM[9] ;
74:  F[30:CellAlarm]=(ON) ;
75:  ENDIF ;
76:   ;
77:  IF (F[40:UAlarm10]) THEN ;
78:  UALM[10] ;
79:  F[30:CellAlarm]=(ON) ;
80:  ENDIF ;
81:   ;
82:  IF (DI[1:LockDoorBtn] OR DI[3:ResetBtn]) THEN ;
83:  F[12:SilenceBuzzer]=(ON) ;
84:  ENDIF ;
85:   ;
/POS
/END

Lights Management

Lights Management

LANGUAGE: Karel

CREATED: 2019-01-01

MODIFIED: 2019-01-01

CODE   
tag icon

/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

Prog z_main

Prog z_main

LANGUAGE: Karel

CREATED: 2016-02-08

MODIFIED: 2019-11-21

CODE   
tag icon

/PROG  Z_MAIN
/ATTR
OWNER  = MNEDITOR;
COMMENT  = “”;
PROG_SIZE = 1932;
CREATE  = DATE 16-02-08  TIME 12:48:42;
MODIFIED = DATE 19-11-21  TIME 11:36:30;
FILE_NAME = ;
VERSION  = 0;
LINE_COUNT = 71;
MEMORY_SIZE = 2424;
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 = 1,*,*,*,*;
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:  !HMI ;
18:  CALL SHOWPG(1) ;
19:   ;
20:  !Air Pressure Check ;
21:  IF (!DI[7:AirPressureOK]),JMP LBL[501] ;
22:   ;
23:  !I/O Simulated Check ;
24:  IF (DO[512:SimlulatedIO] AND !UO[8:TP enabled]),JMP LBL[502] ;
25:   ;
26:  !At Perch Check ;
27:  IF (!UO[7:At perch]),JMP LBL[503] ;
28:   ;
29:  !Space Check 1 Enable Check ;
30:  IF (!F[3:SpaceChk1Enb]),JMP LBL[504] ;
31:   ;
32:  !Programs Renaming ;
33:  CALL RENAME_PROG0    ;
34:  IF (R[21:ProdSelection]=0),JMP LBL[505] ;
35:   ;
36:  !General Override ;
37:  OVERRIDE=R[1:GlobalOverride] ;
38:   ;
39:  !Main Program ;
40:  CALL SR[2]    ;
41:  JMP LBL[9000] ;
42:   ;
43:  LBL[501:AirPressureAlarm] ;
44:  F[31:UAlarm1]=(ON) ;
45:  F[30:CellAlarm]=(ON) ;
46:  END ;
47:   ;
48:  LBL[502:SimulatedIOAlarm] ;
49:  F[32:UAlarm2]=(ON) ;
50:  F[30:CellAlarm]=(ON) ;
51:  END ;
52:   ;
53:  LBL[503:AtPerchAlarm] ;
54:  F[33:UAlarm3]=(ON) ;
55:  F[30:CellAlarm]=(ON) ;
56:  END ;
57:   ;
58:  LBL[504:SpaceCheck1Alarm] ;
59:  F[34:UAlarm4]=(ON) ;
60:  F[30:CellAlarm]=(ON) ;
61:  END ;
62:   ;
63:  LBL[505:ProdSelectAlarm] ;
64:  F[35:UAlarm5]=(ON) ;
65:  F[30:CellAlarm]=(ON) ;
66:  END ;
67:   ;
68:  !Stop Prod ;
69:  LBL[9000] ;
70:  F[14:StopProdReq]=(OFF) ;
71:  END ;
/POS
/END

Standard Logic

Standard Logic

LANGUAGE: Karel

CREATED: 2019-10-15

MODIFIED: 2019-11-21

CODE   
tag icon

/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

Start/Restart Lock Cell

Start/Restart Lock Cell

LANGUAGE: Karel

CREATED: 2017-04-20

MODIFIED: 2019-11-21

CODE   
tag icon

/PROG  BSTARTRESETLOCK
/ATTR
OWNER  = MNEDITOR;
COMMENT  = “StartResLockCell”;
PROG_SIZE = 3126;
CREATE  = DATE 17-04-20  TIME 09:14:42;
MODIFIED = DATE 19-11-21  TIME 11:34:24;
FILE_NAME = BGLSTART;
VERSION  = 0;
LINE_COUNT = 114;
MEMORY_SIZE = 3458;
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
/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:On reset la sequence si elle est plus grande que 0 et on depasse le
:  temps max ;
18:  IF (TIMER[20]>10 AND R[15:BGLTrackSeq]<>0),R[15:BGLTrackSeq]=(9001) ;
19:   ;
20:   ;
21:  IF (R[15:BGLTrackSeq]>9000 AND DI[2:StartBtn]=OFF AND DI[3:ResetBtn]=OFF AND DI[1:LockDoorBtn]=OFF) THEN ;
22:  $TIMER[20].$TIMER_VAL=0 ;
23:  R[15:BGLTrackSeq]=0    ;
24:  ENDIF ;
25:   ;
26:  –eg:Sequence Selection ;
27:  IF (R[15:BGLTrackSeq]=0) THEN ;
28:  $TIMER[20].$TIMER_VAL=0 ;
29:   ;
30:  IF (DI[6:FenceOK]=OFF AND DO[1:LockDoors]=ON),DO[1:LockDoors]=(OFF) ;
31:   ;
32:  IF (DI[1:LockDoorBtn]=ON),R[15:BGLTrackSeq]=(31) ;
33:  IF (DI[3:ResetBtn]=ON),R[15:BGLTrackSeq]=(11) ;
34:  IF (DI[2:StartBtn]=ON AND UO[2:System ready]=ON AND UO[1:Cmd enabled]=ON AND UO[3:Prg running]=OFF),R[15:BGLTrackSeq]=(21) ;
35:  ENDIF ;
36:   ;
37:   ;
38:   ;
39:  –eg:== RESET ROBOT == ;
40:  IF (R[15:BGLTrackSeq]=11) THEN ;
41:  F[1023:UIReset]=(ON) ;
42:   ;
43:  IF (TIMER[20]>3 AND DI[3:ResetBtn]=ON) THEN ;
44:  F[1022:UIStop]=(ON) ;
45:  R[15:BGLTrackSeq]=9999    ;
46:  ENDIF ;
47:   ;
48:  IF (DI[3:ResetBtn]=OFF),R[15:BGLTrackSeq]=(9999) ;
49:   ;
50:  ENDIF ;
51:   ;
52:  !END RESET ROBOT ;
53:   ;
54:  –eg:== DEPART ROBOT == ;
55:  IF (R[15:BGLTrackSeq]=21) THEN ;
56:  IF (F[10:MemTeachOff]=OFF),R[15:BGLTrackSeq]=(22) ;
57:  IF (F[10:MemTeachOff]=ON),R[15:BGLTrackSeq]=(29) ;
58:  ENDIF ;
59:   ;
60:  –eg:Si le teach a ete active on fait un cycle stop ;
61:  IF (R[15:BGLTrackSeq]=22) THEN ;
62:  F[1022:UIStop]=(ON) ;
63:  F[10:MemTeachOff]=(ON) ;
64:  R[15:BGLTrackSeq]=23    ;
65:  ENDIF ;
66:   ;
67:  –eg:Quand le programme est arrete on passe a l’autre etape ;
68:  IF (R[15:BGLTrackSeq]=23 AND F[1022:UIStop]=OFF AND UO[3:Prg running]=OFF) THEN ;
69:  R[15:BGLTrackSeq]=29    ;
70:  ENDIF ;
71:   ;
72:  –eg:On demarre le robot ;
73:  IF (R[15:BGLTrackSeq]=29) THEN ;
74:  F[1024:UIStart]=(ON) ;
75:  R[15:BGLTrackSeq]=9999    ;
76:  ENDIF ;
77:  !END START ROBOT ;
78:   ;
79:   ;
80:   ;
81:  –eg:Lock/Unlock Door Sequence ;
82:   ;
83:  –eg:1st Step ;
84:  IF (R[15:BGLTrackSeq]=31) THEN ;
85:  IF (TIMER[20]>3),R[15:BGLTrackSeq]=(32) ;
86:  IF (TIMER[20]<=3 AND DI[1:LockDoorBtn]=OFF),R[15:BGLTrackSeq]=(33) ;
87:  ENDIF ;
88:   ;
89:  –eg:Unlock Door ;
90:  IF (R[15:BGLTrackSeq]=32) THEN ;
91:  DO[1:LockDoors]=OFF ;
92:  R[15:BGLTrackSeq]=9999    ;
93:  ENDIF ;
94:   ;
95:  –eg:Lock Door ;
96:  IF (R[15:BGLTrackSeq]=33) THEN ;
97:  DO[1:LockDoors]=ON ;
98:  //IF (DI[6:FenceOK]=ON),DO[218:NX_Free]=(ON) ;
99:  IF (DI[6:FenceOK]=ON),R[15:BGLTrackSeq]=(100) ;
100:  IF (DI[6:FenceOK]=OFF AND TIMER[20]>2),R[15:BGLTrackSeq]=(32) ;
101:  ENDIF ;
102:   ;
103:  –eg:EuropMap73 ACK ;
104:  IF (R[15:BGLTrackSeq]=100 AND TIMER[20]>3) THEN ;
105:  DO[218:NX_Free]=ON ;
106:  R[15:BGLTrackSeq]=9999    ;
107:  ENDIF ;
108:   ;
109:  IF (DO[218:NX_Free]=ON),DO[218:NX_Free]=PULSE,1.0sec ;
110:   ;
111:   ;
112:  –eg:Lock/Unlock Door Seq. End Section ;
113:   ;
114:   ;
/POS
/END

Pro Home_Direct

Pro Home_Direct

LANGUAGE: Karel

CREATED: 2019-07-08

MODIFIED: 2019-11-22

CODE   
tag icon

/PROG  HOME_DIRECT   Macro
/ATTR
OWNER  = MNEDITOR;
COMMENT  = “”;
PROG_SIZE = 1090;
CREATE  = DATE 19-07-08  TIME 21:51:32;
MODIFIED = DATE 19-11-22  TIME 08:02:42;
FILE_NAME = ;
VERSION  = 0;
LINE_COUNT = 20;
MEMORY_SIZE = 1390;
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 = 1,*,*,*,*;
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:  CALL GET_HOME    ;
18:  UFRAME_NUM=1 ;
19:  UTOOL_NUM=1 ;
20:J PR[1:At Perch] 100% FINE    ;
/POS
/END