uptown47
Lifetime Supporting Member
Hi all
I've got a major problem after translating some S5 code to S7. The system basically lifts up some bottles and places them into boxes.
There are two proxys watching two toothed wheels attached to the motor. The idea being that as the motor spins the proxies count the pulses either up/down or left/right.
The previous S5 system used a special digital input card and OB 2 (interrupt block) in order to count the pulses.
In order to convert to S7 I've used a CPU 314 and used the built in interrupts to call OB 40 on the rising edge of the proxies.
The problem is that every couple of cycles of the machine the "height" word starts incrementing or decrementing as the machine moves left or right (i.e. without the machine going up and down).
I've never set up an OB40 before so it could be a set up problem or a code problem. I think its code but in the interests of completeness I'll try and include as much info as I can here...
Here's a piccy of my hardware config...
My proxies are wired into I 2.0 and I 2.1
There are also "product pick up" and "product drop" sensors wired to I 2.6 and I 2.7
Here is a copy of OB 40...
FB 3, 4, 5, and 6 do the addition and subtraction.
Here is a copy of them...
MW 50 is the "height count" and MW 40 is the left/right count.
MW 50 should go from -90 to +90 roughly and MW 40 goes from 0 to 280 ish.
MW 50 is the one giving me the trouble. (although that's not to say that MW 40 won't be a problem as well when the machine runs properly).
The machine moves to a STOP LEFT sensor and resets MW 40. Drives down and picks up product.
Then it drives up and moves right to a STOP RIGHT sensor. Drives down and drops product off.
The LEFT and RIGHT extremes both reset MW 40 to 0 which is why there is only an ADD for MW 40.
When the machine is moving left or right it also seemingly randomly increments or decrements MW 50 ???
MW 50 will start off at +90 after picking up the product, then, as the machine moves over (not altering its height) MW 50 decrements to a minus number. Its not always the same number. Its like its getting 'phantom' pulses somehow??..??
Anyone any ideas why this could be??
This is a really massive problem for me and I would be very grateful if you have any ideas?
Many many thanks
I've got a major problem after translating some S5 code to S7. The system basically lifts up some bottles and places them into boxes.
There are two proxys watching two toothed wheels attached to the motor. The idea being that as the motor spins the proxies count the pulses either up/down or left/right.
The previous S5 system used a special digital input card and OB 2 (interrupt block) in order to count the pulses.
In order to convert to S7 I've used a CPU 314 and used the built in interrupts to call OB 40 on the rising edge of the proxies.
The problem is that every couple of cycles of the machine the "height" word starts incrementing or decrementing as the machine moves left or right (i.e. without the machine going up and down).
I've never set up an OB40 before so it could be a set up problem or a code problem. I think its code but in the interests of completeness I'll try and include as much info as I can here...
Here's a piccy of my hardware config...
My proxies are wired into I 2.0 and I 2.1
There are also "product pick up" and "product drop" sensors wired to I 2.6 and I 2.7
Here is a copy of OB 40...
L PIB 2
T IB 3
//;
A "I 3.0"
A M 0.0
JCN X000
CALL FB 3 , DB75
X000: NOP 0
//;
A "I 3.1"
A "Q 13.2"
A M 0.0
JCN X001
CALL FB 4 , DB76
X001: NOP 0
//;
A "I 3.1"
A(
AN "Q 13.2"
A M 0.0
O M 1.1
)
JCN X002
CALL FB 5 , DB77
X002: NOP 0
//;
A(
A M 3.1
A "I 3.6"
O "I 3.7"
)
A "I 6.0"
JCN X003
CALL FB 6 , DB78
X003: NOP 0
FB 3, 4, 5, and 6 do the addition and subtraction.
Here is a copy of them...
**** FC 3 *****
L MW 40
L 1
+I
T MW 40
NOP 0
***************
**** FC 4 *****
L MW 50
L 1
+I
T MW 50
NOP 0
***************
**** FC 5 *****
L MW 50
L 1
-I
T MW 50
NOP 0
***************
**** FC 6 *****
L QW 12
L W#16#FFFD
AW
T PQW 12
NOP 0
***************
MW 50 is the "height count" and MW 40 is the left/right count.
MW 50 should go from -90 to +90 roughly and MW 40 goes from 0 to 280 ish.
MW 50 is the one giving me the trouble. (although that's not to say that MW 40 won't be a problem as well when the machine runs properly).
The machine moves to a STOP LEFT sensor and resets MW 40. Drives down and picks up product.
Then it drives up and moves right to a STOP RIGHT sensor. Drives down and drops product off.
The LEFT and RIGHT extremes both reset MW 40 to 0 which is why there is only an ADD for MW 40.
When the machine is moving left or right it also seemingly randomly increments or decrements MW 50 ???
MW 50 will start off at +90 after picking up the product, then, as the machine moves over (not altering its height) MW 50 decrements to a minus number. Its not always the same number. Its like its getting 'phantom' pulses somehow??..??
Anyone any ideas why this could be??
This is a really massive problem for me and I would be very grateful if you have any ideas?
Many many thanks