Hi
I’m having problems with the logic for my tool changer. I can’t seam to figure out why the logic will not work right. I’ve looked at the program for so long that I don’t know if I’m not seeing the problem or what?
Here’s some of the back ground. It has 20 tools 1-20 in a counter clockwise rotation. Lets say you have tool #8 in the spindle and you call Tool #6 the tool carriage should rotate counter clockwise. When you run the program it will rotate clockwise. I basically copied this part of the program from the book anybody see anything wrong with this statement. In the log file the variable \95 shows -2 so that tells me that it is doing the math right but it seems like it reads the first If statement then it turns on #22?
DISPVARB \90
READVARB \90
'Subtract current tool from last tool
\95={t-\90}
DISPVARB \95
'Start the tool changer motor rotating CW
IF \95> -10 THENIF \95<=0 THEN #22=1
'Start the tool changer motor rotating CCW
IF \95<= -10 THEN #21=1
'Start the tool changer motor rotating CW
IF \95> 0 THENIF \95< 10 THEN #22=1
'Start the tool changer motor rotating CCW
IF \95>= 10 THEN #21=1


LinkBack URL
About LinkBacks




