Palletizing - Distance Control (Method 1)
The first palletizing example works fine under applications that do not require cycle recovery upon estop or power down.
The following example uses a "global variable" to maintain the variable count controlling the pallet position increment.
Global variables do not reset after estop or power down and thus retain their data until manually cleared.
The previous examples used a "local variable" which does reset after estop and/or power down.
At any rate, both method 1 and method 2 "preload" the previous value of the variables into the corresponding register number and resumes palletizing where it had left off.
The best way to accomplish this is to use global variables and flags so that the point on the pallet is retained.
If the pallet is interrupted (ie. estop or power down) the global flag is checked and if it is not off, the pallet did not finish and the pallet position is "preloaded" into the variable.
The following method descriptions are exactly the same as the first palletizing example. If you have already read that section you can skip over the two method descriptions.
Method 1 - Distance Control
The first method to control palletizing operations uses the uniform distance between points in the pallet matrix. In an ideal palletizing operation, the distance between columns and rows is the same, however, if they are different it's just as easy to implement this method. Here's how the method works:
(Assuming we are moving from left to right on a pallet)
* The first point on the pallet is taught.
1. The distance between columns (and/or rows) is initialized
2. (start loop)
3. The pallet point is moved to in the program.
4. The point data is incremented in the X (column) direction
5. End of row?
6. If not at end of row, loop back up to 1.
7. If at end of row, increment row
8. At the last row?
9. If not at last row, loop back up to 1.
10. If at last row, restart pallet and reset distance, or end program.
This method proves to be very flexible as the distance increment can be altered according to what pallet you are working on. If the pallet size changes, all that needs to be changed in the program is the distance amount and possibly the first point on the pallet.
The problem with this method is that the code is a bit lengthy and extra logic steps must be in place for the position control to occur properly.
The next method, using OFST, results in shorter code