Program Example - Path-PLS: Equidistant Points from Start/End as Position Source

From SoftMC-Wiki
Jump to: navigation, search

This program uses two positions, which are distanced equally from the start and the end of the motion, as PLS positions. The PLS output is toggled at 10 mm or 70 mm after the start position or before the target position, depending on PLSRelatedTo.

 

Common Shared GXY as group of axnm = A1 axnm = A2 of XY
Common Shared P1 as PLS GXY Sys.Dout.1
Common Shared P2 as PLS GXY Sys.Dout.2
Common Shared P3 as PLS GXY Sys.Dout.3

Program

   CreatePLSData P1 2 
   CreatePLSData P2 2
   CreatePLSData P3 2
   P1.PLSPosition[1] = 10
   P1.PLSPosition[2] = 70
   P1.PLSRelatedTo   = 0
   P2.PLSPosition[1] = 10
   P2.PLSPosition[2] = 70
   P2.PLSRelatedTo   = 1
   P3.PLSPosition[1] = 10
   P3.PLSPosition[2] = 70
   P3.PLSRelatedTo   = 0
Attach GXY
   GXY.PLSSource = PathLength 
   GXY.en = 1
   With GXY
   MOVES {100,0} WithPLS = P1
   MOVES {0,100} WithPLS = P2
   MOVES {0,0}   WithPLS = P3
   End With 
Detach GXY
End program

RTENOTITLE