update motion sync
This commit is contained in:
34
Readme.md
34
Readme.md
@@ -1016,7 +1016,41 @@ PB_BSREAD -> sample how to configure user Flags
|
||||
|
||||
Gate3[1].Chan[0].UserFlag -> is set to 0 when event triggered (mapped to output FronUnivOut4 in the EVR)
|
||||
|
||||
EVR output powerBrick register $(USR_FLAG_ID)
|
||||
FrontUnivOut4 Gate3[1].Chan[0].UserFlag 5
|
||||
FrontUnivOut5 Gate3[1].Chan[1].UserFlag 6
|
||||
FrontUnivOut6 Gate3[1].Chan[2].UserFlag 7
|
||||
|
||||
Event 254 -> Pulser 0 -> FrontUnivOut4 Gate3[1].Chan[0].UserFlag
|
||||
Event 40 -> Pulser 1 -> FrontUnivOut4 Gate3[1].Chan[1].UserFlag
|
||||
Event 22 -> Pulser 2 -> FrontUnivOut4 Gate3[1].Chan[2].UserFlag
|
||||
|
||||
caput SAR-CVME-TIFALL5-EVG0:SoftEvt-EvtCode-SP 254
|
||||
|
||||
|
||||
Sample test code for sync:
|
||||
|
||||
open prog 2
|
||||
Gate3[0].GpioData[0].16.1=0
|
||||
linearabs
|
||||
//X50Y-0
|
||||
dwell10
|
||||
while(Gate3[1].Chan[0].UserFlag==0){}
|
||||
while(1)
|
||||
{
|
||||
if(Gate3[1].Chan[1].UserFlag==0)
|
||||
{
|
||||
break
|
||||
}
|
||||
}
|
||||
Gather.Enable=2
|
||||
Gate3[0].GpioData[0].16.1=1
|
||||
//pvt40abs
|
||||
//X50:443.604Y-0:0
|
||||
dwell1000
|
||||
Gather.Enable=0
|
||||
close
|
||||
b2r
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
file "$(mrfioc2_TEMPLATES=db)/evr-pcie-300DC.db"
|
||||
{
|
||||
{
|
||||
|
||||
|
||||
## Global settings
|
||||
ExtInhib-Sel=0, #0 = Use Inhibit, 1 = Always permitt : Use HW trigger inhibit (EVRTG only)
|
||||
Link-Clk-SP=142.8, #50-150 : Event Link speed (MHz)
|
||||
@@ -44,7 +44,7 @@ file "$(mrfioc2_TEMPLATES=db)/evr-pcie-300DC.db"
|
||||
PS7-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output.
|
||||
PS7-PulserMap-L-SP=0, #0-65535 :Trigger a pulser on prescaler rising edge. Pulsers 0-15 are bit-wise selectable
|
||||
PS7-PulserMap-H-SP=0, #0-255 :Trigger a pulser on prescaler rising edge. Pulsers 16-23 are bit-wise selectable
|
||||
|
||||
|
||||
## Distributed bus
|
||||
PulserMap-Dbus0-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable
|
||||
PulserMap-Dbus1-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable
|
||||
@@ -54,13 +54,13 @@ file "$(mrfioc2_TEMPLATES=db)/evr-pcie-300DC.db"
|
||||
PulserMap-Dbus5-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable
|
||||
PulserMap-Dbus6-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable
|
||||
PulserMap-Dbus7-SP=0, #0-16777215 :Trigger a pulser on DBus bit rising edge. Pulsers 0-23 are bit-wise selectable
|
||||
|
||||
|
||||
|
||||
## Pulsers
|
||||
Pul0-Name-I="Pulser 0" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul0-Name-I.DESC="Pulse for WSC readout." #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul0-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul0-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul0-Polarity-Sel=1, #0 = Active High, 1 = Active Low
|
||||
Pul0-Delay-SP=0, #Pulser delay in us (DI 1 event at 5400, need to trigger for bunch at 7500)
|
||||
Pul0-Width-SP=5000, #Pulser width in us
|
||||
Pul0-Prescaler-SP=1, #0-65535 : Pulser prescaler
|
||||
@@ -68,24 +68,24 @@ file "$(mrfioc2_TEMPLATES=db)/evr-pcie-300DC.db"
|
||||
Pul1-Name-I="Pulser 1" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul1-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul1-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul1-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul1-Delay-SP=0, #Pulser delay in us
|
||||
Pul1-Width-SP=0, #Pulser width in us
|
||||
Pul1-Polarity-Sel=1, #0 = Active High, 1 = Active Low
|
||||
Pul1-Delay-SP=0, #Pulser delay in us
|
||||
Pul1-Width-SP=5000, #Pulser width in us
|
||||
Pul1-Prescaler-SP=1, #0-65535 : Pulser prescaler
|
||||
|
||||
Pul2-Name-I="Pulser 2" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul2-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul2-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul2-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul2-Delay-SP=0, #Pulser delay in us
|
||||
Pul2-Width-SP=0, #Pulser width in us
|
||||
Pul2-Polarity-Sel=1, #0 = Active High, 1 = Active Low
|
||||
Pul2-Delay-SP=0, #Pulser delay in us
|
||||
Pul2-Width-SP=5000, #Pulser width in us
|
||||
Pul2-Prescaler-SP=1, #0-65535 : Pulser prescaler
|
||||
|
||||
Pul3-Name-I="Pulser 3" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul3-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul3-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul3-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul3-Delay-SP=0, #Pulser delay in us
|
||||
Pul3-Delay-SP=0, #Pulser delay in us
|
||||
Pul3-Width-SP=0, #Pulser width in us
|
||||
Pul3-Prescaler-SP=1, #0-65535 : Pulser prescaler
|
||||
|
||||
@@ -93,84 +93,84 @@ file "$(mrfioc2_TEMPLATES=db)/evr-pcie-300DC.db"
|
||||
Pul4-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul4-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul4-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul4-Delay-SP=0, #Pulser delay in us
|
||||
Pul4-Delay-SP=0, #Pulser delay in us
|
||||
Pul4-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul5-Name-I="Pulser 5" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul5-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul5-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul5-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul5-Delay-SP=0, #Pulser delay in us
|
||||
Pul5-Delay-SP=0, #Pulser delay in us
|
||||
Pul5-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul6-Name-I="Pulser 6" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul6-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul6-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul6-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul6-Delay-SP=0, #Pulser delay in us
|
||||
Pul6-Delay-SP=0, #Pulser delay in us
|
||||
Pul6-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul7-Name-I="Pulser 7" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul7-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul7-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul7-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul7-Delay-SP=0, #Pulser delay in us
|
||||
Pul7-Delay-SP=0, #Pulser delay in us
|
||||
Pul7-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul8-Name-I="Pulser 8" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul8-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul8-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul8-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul8-Delay-SP=0, #Pulser delay in us
|
||||
Pul8-Delay-SP=0, #Pulser delay in us
|
||||
Pul8-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul9-Name-I="Pulser 9" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul9-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul9-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul9-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul9-Delay-SP=0, #Pulser delay in us
|
||||
Pul9-Delay-SP=0, #Pulser delay in us
|
||||
Pul9-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul10-Name-I="Pulser 10" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul10-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul10-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul10-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul10-Delay-SP=0, #Pulser delay in us
|
||||
Pul10-Delay-SP=0, #Pulser delay in us
|
||||
Pul10-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul11-Name-I="Pulser 11" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul11-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul11-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul11-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul11-Delay-SP=0, #Pulser delay in us
|
||||
Pul11-Delay-SP=0, #Pulser delay in us
|
||||
Pul11-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul12-Name-I="Pulser 12" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul12-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul12-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul12-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul12-Delay-SP=0, #Pulser delay in us
|
||||
Pul12-Delay-SP=0, #Pulser delay in us
|
||||
Pul12-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul13-Name-I="Pulser 13" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul13-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul13-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul13-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul13-Delay-SP=0, #Pulser delay in us
|
||||
Pul13-Delay-SP=0, #Pulser delay in us
|
||||
Pul13-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul14-Name-I="Pulser 14" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul14-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul14-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul14-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul14-Delay-SP=0, #Pulser delay in us
|
||||
Pul14-Delay-SP=0, #Pulser delay in us
|
||||
Pul14-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
Pul15-Name-I="Pulser 15" #Description of the pulser. Maximum 40 characters allowed!
|
||||
Pul15-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
|
||||
Pul15-Ena-Sel=1, #0 = Disabled, 1 = Enabled
|
||||
Pul15-Polarity-Sel=0, #0 = Active High, 1 = Active Low
|
||||
Pul15-Delay-SP=0, #Pulser delay in us
|
||||
Pul15-Delay-SP=0, #Pulser delay in us
|
||||
Pul15-Width-SP=0, #0-65535 : Width in us
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ file "$(mrfioc2_TEMPLATES=db)/evr-pcie-300DC.db"
|
||||
# 34 DBus 2
|
||||
# 35 DBus 3
|
||||
# 36 DBus 4
|
||||
# 37 DBus 5
|
||||
# 37 DBus 5
|
||||
# 38 DBus 6
|
||||
# 39 Dbus 7
|
||||
# 40 Prescaler 0
|
||||
@@ -336,14 +336,14 @@ pattern { EVT, CODE, FLNK }
|
||||
{ "28", "28", "" } # BeamSync read-1
|
||||
}
|
||||
# If you want to enable measuring the jitter on received events comment out the previous substitution and use this one instead
|
||||
#
|
||||
#
|
||||
# Additinal macros:
|
||||
# HIST_LEN = number of histogram bins created from frequency measurements. Default 200.
|
||||
# HIST_ULIM = histogram upper limit. Default 12.
|
||||
# HIST_LLIM = histogram lower limit. Default 8.
|
||||
#
|
||||
#
|
||||
# NOTE: make sure your system supports the 'histogram' record before using this template!
|
||||
#
|
||||
#
|
||||
#file "$(mrfioc2_TEMPLATES=db)/evr-softEvent-measure.template"{
|
||||
#pattern { EVT, CODE, FLNK }
|
||||
# { "1", "1", "" }
|
||||
@@ -401,12 +401,12 @@ pattern { EVT, FUNC }
|
||||
# EVT = Initial event code
|
||||
# ID = Mappings must have unique ID for each PID-F combination.
|
||||
# Only mappings with ID=0 are displayed in the GUI
|
||||
#
|
||||
#
|
||||
file "$(mrfioc2_TEMPLATES=db)/evr-pulserMap.template"{
|
||||
pattern {PID F, EVT, ID}
|
||||
{0, Trig, 22, 0 } # ESA laser diag-1
|
||||
{1, Trig, 0, 0 }
|
||||
{2, Trig, 0, 0 }
|
||||
{0, Trig, 254, 0 } # ESB JF-Start
|
||||
{1, Trig, 40, 0 } # ESB JF-Acquire frame
|
||||
{2, Trig, 22, 0 } # ESA laser diag-1
|
||||
{3, Trig, 0, 0 }
|
||||
{4, Trig, 0, 0 }
|
||||
{5, Trig, 0, 0 }
|
||||
@@ -464,8 +464,8 @@ pattern {PID F, EVT, ID}
|
||||
# Macros:
|
||||
# SYS = System name (auto expanded by parent)
|
||||
# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0. (auto expanded by parent)
|
||||
#
|
||||
#file "$(mrfioc2_TEMPLATES=db)/flash.template"
|
||||
#
|
||||
#file "$(mrfioc2_TEMPLATES=db)/flash.template"
|
||||
#{
|
||||
# {}
|
||||
#}
|
||||
|
||||
@@ -95,23 +95,24 @@ close
|
||||
# - waits raising edge of <flag> and the sets DesTimeBase=ServoPeriod
|
||||
|
||||
# flag ='PowerBrick[0].GpioData[0].0.1==1'
|
||||
flag = 'Gate3[1].Chan[0].UserFlag==0'
|
||||
flag0 = 'Gate3[1].Chan[0].UserFlag==0'
|
||||
flag1 = 'Gate3[1].Chan[1].UserFlag==0'
|
||||
prg = '''
|
||||
//L0=Sys.PhaseCount
|
||||
//send 1"sync0 %d:%d\\n",Sys.PhaseCount,Sys.PhaseCount-L0
|
||||
while({flag}){{}}
|
||||
while({flag0}){{}}
|
||||
//send 1"sync1 %d:%d\\n",Sys.PhaseCount,Sys.PhaseCount-L0
|
||||
//L1=Sys.PhaseCount
|
||||
while(1)
|
||||
{{
|
||||
if({flag})
|
||||
if({flag1})
|
||||
{{
|
||||
//PowerBrick[0].GpioData[0].16.8=255
|
||||
//send 1"sync2 %d:%d\\n",Sys.PhaseCount,Sys.PhaseCount-L1
|
||||
break
|
||||
}}
|
||||
}}
|
||||
'''.format(plcId=plcId, crdId=crdId, flag=flag)
|
||||
'''.format(plcId=plcId, crdId=crdId, flag0=flag0, flag1=flag1)
|
||||
self.sync_prg = prg
|
||||
self.sync_run = '&{crdId}b{prgId}r'''.format(prgId=prgId, plcId=plcId, crdId=crdId)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user