adding Q1 for triggering status

This commit is contained in:
2018-11-29 15:56:05 +01:00
parent d16249d863
commit 38a8c8484b
6 changed files with 122 additions and 29 deletions

View File

@@ -1,26 +1,27 @@
#some further usefull PMAC commands:
# list pc , 10 //list program counter during motion exec
# buffer //list allocated buffers
#the rotary stuff only works from gpascii, not gpasciiCommander
#delete rotary
#define rotary 4096 //allocates mem
#open rotary //same as open prog 0
#
# X100 Y100
# X200 Y300
# X600 Y500
# adding lines alway are acknowledged with ACK,
# if not, it means that the buffer is full
# it will acknowlegde when there is again free space.
# close
# delete rotary
#!/usr/bin/env python
# *-----------------------------------------------------------------------*
# | |
# | Copyright (c) 2016 by Paul Scherrer Institute (http://www.psi.ch) |
# | |
# | Author Thierry Zamofing (thierry.zamofing@psi.ch) |
# *-----------------------------------------------------------------------*
'''
Coord[1].Q[0] : sync points when using setup_sync(mode=2)
0: after setup_sync(mode=2) call
idx: index of position during run
-1: pvt motion is finished
Coord[1].Q[1] : sync trigger: when setup_sync(mode=1 or 2)
0: idle
1: waiting for trigger
2: running
#from other gpascii
#list rotary
#rotfree
#size
#b0s //start the rotary buffer in single step mode
Gather.Enable : 1: after .setup_gather() called
2: during data gathering
0: when gather finished
Gather.Samples : number af gathered data samples
'''
import os, sys
sys.path.insert(0,os.path.expanduser('~/Documents/prj/SwissFEL/PBTools/'))
@@ -63,10 +64,12 @@ class MotionBase:
prg = '''
//L0=Sys.PhaseCount
//send 1"sync0 %d:%d\\n",Sys.PhaseCount,Sys.PhaseCount-L0
Coord[1].Q[1]=1
while({flag0}){{}}
//send 1"sync1 %d:%d\\n",Sys.PhaseCount,Sys.PhaseCount-L0
//L1=Sys.PhaseCount
while({flag1}){{}}
Coord[1].Q[1]=2
//PowerBrick[0].GpioData[0].16.8=255
//send 1"sync2 %d:%d\\n",Sys.PhaseCount,Sys.PhaseCount-L1
'''.format(plcId=plcId, crdId=crdId, flag0=flag0, flag1=flag1)