Many thanks for your answer.
but...you said
"I have used reference points to set up position variables in the correct format and tool."
I really thought that the points recorded as refp is in pulse so it's mechanic position of robot without matter of tool. How does the tool has to do with it?
I know that there is a corelation between position variable(x,y,z) and tool because it's in "mm" not pulse.
Could you write a few lines of program what you mean?