Thanks for your reply Iprogram, the program is the original, I solved the problem writing a fixed 0 to infeed in alt indeed loop because I don't want to use this option.
Doing this the program continues.
Thank you all.
Thanks for your reply Iprogram, the program is the original, I solved the problem writing a fixed 0 to infeed in alt indeed loop because I don't want to use this option.
Doing this the program continues.
Thank you all.
the code....
/PROG PLCPART Macro
/ATTR
OWNER = MNEDITOR;
COMMENT = "PLC Get Prt Data";
PROG_SIZE = 3523;
CREATE = DATE 00-02-15 TIME 07:22:44;
MODIFIED = DATE 21-11-12 TIME 17:13:12;
FILE_NAME = PLCPART;
VERSION = 0;
LINE_COUNT = 140;
MEMORY_SIZE = 3987;
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: !-------------------------------- ;
2: !Communication program to get ;
3: !Cycle Start Data from PLC. ;
4: !-------------------------------- ;
5: !Register Assignments ;
6: !R[37: Total Cycles] ;
7: !R[49: Load Type] ;
8: !R[51: Pallet Number] ;
9: !R[52: Load Number] ;
10: !R[53: Infeed Number] ;
11: !R[57: Cycle Counter] ;
12: !-------------------------------- ;
13: !I/O Assignments ;
14: !DI[32: PLC - request to send] ;
15: !DO[32: Robot - ready for read] ;
16: !GI[1: Read data from PLC] ;
17: !GO[1: Echo data to PLC] ;
18: !-------------------------------- ;
19: ;
20: !Receiving PLC Cyc Start Data. ;
21: UALM[11] ;
22: ;
23: !Ready to receive Num Cycles ;
24: !Min. = 1, Max. = 20. ;
25: !Set total num of cycles to R[37] ;
26: R[37:Total cycles]=4 ;
27: ;
28: !-------------------------------- ;
29: !Initialize Loop Counter ;
30: R[57:PLC Loop Counter]=0 ;
31: !-------------------------------- ;
32: LBL[10:Cycle Data Loop] ;
33: !Reset Alt Infeed Counter ;
34: R[26:Unit counter]=0 ;
35: !Increment loop counter. ;
36: !Exit if cycle > total cycles. ;
37: R[57:PLC Loop Counter]=R[57:PLC Loop Counter]+1 ;
38: IF R[57:PLC Loop Counter]>R[37:Total cycles],JMP LBL[100] ;
39: ;
40: !-------------------------------- ;
41: !Ready to receive load number ;
42: !0 = disabled, to 999 Max. ;
43: !Set Load number to R[52] ;
44: R[52:PLC Load Num]=1 ;
45: ;
46: !-------------------------------- ;
47: !Ready to receive load type ;
48: !0 = Std, 1 Mixed. ;
49: !Set Load type to R[49] ;
50: R[49:Unitload Type]=0 ;
51: !-------------------------------- ;
52: !Ready to receive Pallet number. ;
53: !Min. = 0, Max. = 16. ;
54: !Set Pallet number to R[51] ;
55: R[51:PLC Pallet Num]=R[57:PLC Loop Counter] ;
56: !-------------------------------- ;
57: ;
58: !Ready to receive Layer number. ;
59: !Min. = 0, Max. = 40 ;
60: !Set Layer number to R[84] ;
61: SELECT R[57:PLC Loop Counter]=1,JMP LBL[1] ;
62: =2,JMP LBL[2] ;
63: =3,JMP LBL[3] ;
64: =4,JMP LBL[4] ;
65: ELSE,JMP LBL[5] ;
66: ;
67: LBL[1] ;
68: R[84:Nxt Layer]=GI[1] ;
69: JMP LBL[5] ;
70: ;
71: LBL[2] ;
72: R[84:Nxt Layer]=GI[2] ;
73: JMP LBL[5] ;
74: ;
75: LBL[3] ;
76: R[84:Nxt Layer]=GI[3] ;
77: JMP LBL[5] ;
78: ;
79: LBL[4] ;
80: R[84:Nxt Layer]=GI[4] ;
81: JMP LBL[5] ;
82: ;
83: LBL[5] ;
84: ;
85: !-------------------------------- ;
86: !Ready to receive Uniit number. ;
87: !Min. = 0, Max. = 50 ;
88: !Set Unit number to R[85] ;
89: SELECT R[57:PLC Loop Counter]=1,JMP LBL[6] ;
90: =2,JMP LBL[7] ;
91: =3,JMP LBL[8] ;
92: =4,JMP LBL[9] ;
93: ELSE,JMP LBL[11] ;
94: ;
95: LBL[6] ;
96: R[85:Nxt Unit]=GI[5] ;
97: JMP LBL[11] ;
98: ;
99: LBL[7] ;
100: R[85:Nxt Unit]=GI[6] ;
101: JMP LBL[11] ;
102: ;
103: LBL[8] ;
104: R[85:Nxt Unit]=GI[7] ;
105: JMP LBL[11] ;
106: ;
107: LBL[9] ;
108: R[85:Nxt Unit]=GI[8] ;
109: JMP LBL[11] ;
110: ;
111: LBL[11] ;
112: !-------------------------------- ;
113: !Ready to receive Infeed number. ;
114: !Min. = 0, Max. = 16. ;
115: !Set Infeed number to R[53] ;
116: R[53:PLC Infeed Num]=R[57:PLC Loop Counter] ;
117: ;
118: !-------------------------------- ;
119: !Assign Data to Karel Variables. ;
120: CALL PMPLCST ;
121: ;
122: !-------------------------------- ;
123: !Check for alternate infeeds. ;
124: !Ready to receive alt infeed. ;
125: LBL[20:Alt-Infeed Loop] ;
126: !Increment alt-infeed count. ;
127: R[26:Unit counter]=R[26:Unit counter]+1 ;
128: !Set Infeed number to R[53] ;
129: R[53:PLC Infeed Num]=R[57:PLC Loop Counter] ;
130: !Set PLC data to KAREL variables. ;
131: WAIT .05(sec) ;
132: CALL PMPLCST ;
133: IF R[53:PLC Infeed Num]=0,JMP LBL[10] ;
134: IF R[26:Unit counter]=16,JMP LBL[10] ;
135: JMP LBL[20] ;
136: ;
137: !-------------------------------- ;
138: !End PLC Communication. ;
139: LBL[100:END PLC Comm] ;
140: ;
/POS
/END
Dear community, please you help.
I am programming Plc start to Fanuc m410 ic with palletpro v9.30.
I don't have Plc and I don't thing that PMC have to hand this, so I modified a little plcpart to take group inputs from Modbus hmi and write the registers.
Plcpart runs fine, but the robot waits semaphore(1) of wcmon... I know that semaphore is set by Karel, but is not doing this.
I see that pmplcst Karel is called for each Plc cycle, and when it inside alt-infeed loop is called each unit counter (16 x 4 in my case)
Someone deals with this problem already.
Sorry about my english.
Thank you