I am new to the FANUC system and am learning how to program .ls files. My ultimate goal is to have a C# application generate a file and load it into the controller and start the program. I found some sample code online and put together a program (Below).
The issue I am having is I do not understand how the coordinates work when in the .LS file. For example I have point 1 defined as:
P[1:"Point1"]{
GP1:
UF : 2, UT : 1, CONFIG : 'N U T, 0, 0, 0',
X = 1000.000 mm, Y = 0.000 mm, Z = 0.000 mm,
W = -90.000 deg, P = 90.000 deg, R = 0.000 deg
};
At the home position the tool is in the correct orientation, Pointing in the -Z direction. When running my application it moves to this point, once reaching it the tool is pointing in the positive Y direction.
I want the tool pointing in the -Z direction at all times , so I changed point 1 to look like:
P[1:"Point1"]{
GP1:
UF : 2, UT : 1, CONFIG : 'N D B, 0, 0, 0',
X = 1000.000 mm, Y = 0.000 mm, Z = 0.000 mm,
W = 0.000 deg, P = 0.000 deg, R = 0.000 deg
};
This causes a fault when I try to run it, with the messages stating "Position not reachable"
I used the virtual pendant to set a PR point, It's value (when viewing the data on the virtual pendant) is:
PR[1:"Home"]{
GP1:
UF : F, UT : F, CONFIG : 'N D B, 0, 0, 0',
X = 500.000 mm, Y = 250.000 mm, Z = 50.000 mm,
W = 0.000 deg, P = 0.000 deg, R = 0.000 deg
};
And the system has no problem with that point.
The points I put are within range of the machine so I don't understand what I am doing incorrectly. Could someone point me to a good definition of how to set the CONFIG value and the W,P,R values, as well as how they relate to each other in order to keep the tool pointing in -Z at each point?
My complete (Working, with Tool pointed in positive Y when not at home position ) program is here:
/PROG MOVE_TO_POINT
/ATTR
OWNER = MNEDITOR;
COMMENT = "Moves to position";
PROG_SIZE = 7326;
CREATE = DATE 17-11-17 TIME 07:43:46;
MODIFIED = DATE 17-11-17 TIME 07:43:46;
FILE_NAME = ;
VERSION = 0;
LINE_COUNT = 267;
MEMORY_SIZE = 8102;
PROTECT = READ_WRITE;
TCD: STACK_SIZE = 0,
TASK_PRIORITY = 50,
TIME_SLICE = 0,
BUSY_LAMP_OFF = 0,
ABORT_REQUEST = 0,
PAUSE_REQUEST = 0;
DEFAULT_GROUP = 1,*,*,*,*;
CONTROL_CODE = 00000000 00000000;
/APPL
/MN
: ! ****************************** ;
: ! Robot: XX ;
: ! ****************************** ;
: ;
: UTOOL_NUM=1 ;
: UFRAME_NUM=2 ;
: ;
:J P[1] 25% FINE ;
: ;
:J P[2] 50% FINE ;
: ;
:L P[3] 100mm/sec FINE ;
: ;
:J PR[1:Home] 25% FINE ;
: ;
/POS
P[1:"Point1"]{
GP1:
UF : 2, UT : 1, CONFIG : 'N U T, 0, 0, 0',
X = 1000.000 mm, Y = 0.000 mm, Z = 0.000 mm,
W = -90.000 deg, P = 90.000 deg, R = 0.000 deg
};
P[2:"Point2"]{
GP1:
UF : 2, UT : 1, CONFIG : 'N U T, 0, 0, 0',
X = 1000.000 mm, Y = 1000.000 mm, Z = 0.000 mm,
W = -90.000 deg, P = 90.000 deg, R = 0.000 deg
};
P[3:"Point3"]{
GP1:
UF : 2, UT : 1, CONFIG : 'N U T, 0, 0, 0',
X = 1000.000 mm, Y = 1000.000 mm, Z = 1000.000 mm,
W = -90.000 deg, P = 90.000 deg, R = 0.000 deg
};
/END