update motion sync

This commit is contained in:
2018-11-12 15:10:19 +01:00
parent 4927a02706
commit 1e676bcd18
4 changed files with 76 additions and 39 deletions

View File

@@ -142,7 +142,8 @@ class ShapePath(MotionBase):
comm=self.comm
gt=self.gather
gt.set_phasemode(False)
gt.set_address("Motor[3].ActPos","Motor[2].ActPos","Motor[1].ActPos","Motor[3].DesPos","Motor[2].DesPos","Motor[1].DesPos")
#gt.set_address("Motor[3].ActPos","Motor[2].ActPos","Motor[1].ActPos","Motor[3].DesPos","Motor[2].DesPos","Motor[1].DesPos")
gt.set_address("Motor[3].ActPos","Motor[2].ActPos","Motor[1].ActPos","Motor[3].DesPos","Motor[2].DesPos","Motor[1].DesPos","Gate3[1].Chan[1].UserFlag")
gt.set_property(MaxSamples=1000000, Period=acq_per)
ServoPeriod= .2 #0.2ms #Sys.ServoPeriod is dependent of !common() macro
#ServoPeriod=comm.gpascii.servo_period
@@ -555,7 +556,8 @@ if __name__=='__main__':
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(mode=1) #sync with timing system
#sp.setup_sync(mode=1) #sync with timing system (PLC)
sp.setup_sync(mode=2) #sync with timing system (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(scale=10);sp.setup_motion(fnPrg=fn+'.prg',mode=1,pt2pt_time=40,acq_per=1)