# Programming question

• Hi guys,

I have a simple question today, I've been working for a company that use a lot of old yaskawa(NX100, not so old indeed) and a couple of days ago I've found a piece of code like this:

MOVL C00000 V=1000.0

GETS LPX000 \$PX0001

'...

'do some maths

'...

MOVL LP000 V=200.0 PL=0

How much is safe/right doing this?

Getting a position, after moving very fast to a position: it's like do it on the fly?

Also I would use a Pxxx variable not a Cxxx?

• I just tested it on a DX200 and it turns out, it doesn't do it on the fly - you get the exact position.

If the position doesn't have to include shifts or no shifts are active turing the move, it's also possible to use \$PX004 in GETS instruction - that will get the position of the previous MOVx instruction without shift data.

In my opinion using Pxxx vs Cxxx is a matter of preference and what the programmer is after. And also which works better with the current task.

• If the results of the code are repeatable and with desired results, then it is fine. Does the robot achieve that speed? I have programmed quite a few older cells where I had the speed maxed out. The robot never even got close to that speed due to the distance between positions and the accel / decel factors.

Using servo command positions vs. position variables is preference and depends on the application. They each have their advantages and disadvantages.

Alcohol: The cause and solution to all life's problems

• Thanks for your response and opinion.

So in the end it's OK, even if I would prefer something like MOVL Pxxx V=1000.0 with a PL=0, to be sure of reaching the right position.

• it's also possible to use \$PX004 in GETS instruction

\$PX004 is in pulse. He is using \$PX001 which is XYZ Base Frame. A programmer may not know that they would have to use the CNVRT instruction. \$PX007 is XYZ Base Frame minus the shift amount.

Alcohol: The cause and solution to all life's problems