Hi y'all,
I'm Tony, I'm 19 and I'm learning on an ER-4ia. I need to do some simple part moving, using unknown sets and irregular plates to place them on. I come from computer science town, so pardon me for using C# expressions where I lack Karel/TP syntax! I've also learned CNC gcode, although it might not help here...
I could write a simple point-to-point with pick-and-drop RO commands, but that would be exasperating to write and a nightmare to edit for every set of plates. Instead, I would like to go for something a little more KAREL-ly, perhaps some sort of:
Code
VAR
ArrayStartPositions [10] OF INTEGER
ArrayEndPositions [10] OF INTEGER
BEGIN
//Initialize current (start) positions and final (end) position arrays
R1 = 1 //first start position count
R2 = 1 //first end position count
R3 = 0 //no part clamped
FOR R1 <= ArrayStartPositions.SIZE , R1++
| IF ArrayStartPositions [ R1 ] = 1
| THEN
| | J PR[R1] 100% CNT100 Offset , PR[1] // offset height
| | L PR[R1] 500mm/sec FINE
| | CALL PICKUP
| | L PR[R1] 100% CNT100 Offset , PR[1] // offset height
| | R3 = 1
| |
| | FOR R2 <= ArrayEndPositions.SIZE , R2++
| | | IF ArrayStartPositions [ R1 ] = 1
| | | THEN
| | | | J PR[R2] 100% CNT100 Offset , PR[1] // offset height
| | | | L PR[R2] 500mm/sec FINE
| | | | CALL DROP
| | | | L PR[R2] 100% CNT100 Offset , PR[1] // offset height
| | | | R3 = 0
| | | ENDIF
| | ENDFOR
| ENDIF
ENDFOR
IF R3 = 1
THEN
| J P[1] 100% CNT100 Offset , PR[1] // offset height
| L P[1] 500mm/sec FINE
| CALL DROP
| L P[1] 100% CNT100 Offset , PR[1] // offset height
| R3 = 0
ENDIF
END
Display More
How would I approach this? Can TP programs be programmed with arrays like this? Or should I try Karel, although harder to simulate and backplot?
Thanks in advance,
|
Tony