Search the Community
Showing results for tags 'arrays'.
The machine I've built punches holes into long strips of sheet metal. The sheet metal is fed through the machine in 1/4" increments. The operator inputs the position of the holes into the PLC. For example, if the part needs a hole punched at 2", 3.5" and 6", the operator keys in the 8th, 14th, and 24th location (since each position is 1/4"). The PLC then keeps track of the number of increments the sheet metal has moved and activates the hole punch at the appropriate time. My problem is that I want to allow the operator to enter a large quantity of numbers, and the way I'm writing my ladder now would make that very messy. I am trying to figure out vectors or arrays for this, but I am new to visilogic and don't understand the best way to go about doing it. I assume this form of data entry is very common and there is probably a good way to go about doing it. Could anyone point me in the right direction? The way I am doing it now is I have an "Equal To" function block, and I compare the current position of the sheet metal to the entered value. If that's true, the hole gets punched. For example, if the metal is at position 10 (2.5") and the user had entered position 10, the hole gets punched. The problem with this is I have to write a separate function block for each user entered position. I apologize if this doesn't make sense. I have only taken a couple classes in PLC programming and we did not cover this.