Howard Bruce wrote:
> Hi All,
>
> I need to advance the A Axis in a while loop and when a photo cell changes
> state, then advance to a predetermine position.
>
>
Assuming you connect your photo cell to motion.digital-in0 input, you
can do what you need with the following code.
The while loop will loop until the cell is masked by your A axis, so
input goes low. For each pass in the loop, A position increment of 0.1
unit. After the loop exits, A goes to the detected position +5 units.
G0 A0 (go to your part home at full speed)
G91 (switch to incremental mode)
F100 (sets the feed rate)
M66 P0 L0 (loads value of motion.digital-in0 to #5399)
O101 while [#5399 EQ 1] (will loop until the input goes low)
G1 A0.1 (increment A position by +0.1 because of G91
incremental mode)
M66 P0 L0 (loads the input again for the next loop)
O101 endwhile
G1 A5 (go to detected pos + 5)
G90 (switch back to absolute mode)
G1 A0 (retract A to 0)
G53 G0 A0 (retract A to machine home at full speed)
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users