This commit is contained in:
2018-11-27 11:24:39 +01:00
parent 53592c05a3
commit f08cba548e
6 changed files with 118 additions and 59 deletions

View File

@@ -224,20 +224,10 @@ class ShapePath(MotionBase):
prg.append('dwell 100')
prg.append('Gather.Enable=0')
elif mode==1: #### pvt motion
try:
pt2pt_time=kwargs['pt2pt_time'] #how many ms to move to next point (pt2pt_time)
except KeyError:
print('missing pt2pt_time, use default=100ms')
pt2pt_time=100.
pt2pt_time=kwargs.get('pt2pt_time', 100)
self.meta['pt2pt_time']=pt2pt_time
try:
cnt=kwargs['cnt'] #move path multiple times
except KeyError:
cnt=1
try:
sync_frq=kwargs['sync_frq'] #synchronization mark all n points
except KeyError:
sync_frq=10
cnt=kwargs.get('cnt', 1) # move path multiple times
sync_frq=kwargs.get('sync_frq', 10) # synchronization mark all n points
try:
pt=self.ptsCorr
except AttributeError:
@@ -639,9 +629,9 @@ if __name__=='__main__':
#sp.setup_gather(acq_per=1) #Gather.MaxLines=116508 580pts
sp.setup_gather(acq_per=2)
#setup_sync(self, crdId=1, prgId=2, plcId=2, mode=0, **kwargs):
sp.setup_sync() #no sync at all
#sp.setup_sync() #no sync at all
#sp.setup_sync(mode=1) #sync with timing system (PROG)
#sp.setup_sync(mode=2) #sync with timing system and PLC to sync speed (PROG)
sp.setup_sync(mode=2) #sync with timing system and PLC to sync speed (PROG)
#sp.gen_grid_points(w=2,h=2,pitch=50,rnd=.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
#sp.gen_swissmx_points(width=1000,ofs=(-500,0));sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40,acq_per=1)
@@ -650,8 +640,8 @@ if __name__=='__main__':
#sp.gen_grid_points(w=2,h=20,pitch=50,rnd=0);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
#sp.gen_rand_points(n=500, scale=1000);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10,acq_per=1)
#sp.gen_grid_points(w=30,h=30,pitch=50,rnd=0.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
sp.gen_rand_points(n=400, scale=1000);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10)
sp.gen_grid_points(w=30,h=30,pitch=50,rnd=0.2);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40)
#sp.gen_rand_points(n=400, scale=1000);sp.sort_points(xy);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=10)
#>>>setup gather and sync<<<