errlogInit(5000)
< envPaths
# Tell EPICS all about the record types, device-support modules, drivers,
# etc. in this build from CARS
dbLoadDatabase("../../dbd/WithAsyn.dbd")
WithAsyn_registerRecordDeviceDriver(pdbbase)

### Motors
dbLoadTemplate "motor.substitutions.xps"

dbLoadTemplate "XPSAux.substitutions"

# cards (total controllers)
XPSSetup(1)

# card, IP, PORT, number of axes, active poll period (ms), idle poll period (ms)
XPSConfig(0, "newport-xps3", 5001, 3, 10, 5000)

# asynPort, IP address, IP port, poll period (ms)
XPSAuxConfig("XPS_AUX1", "newport-xps3", 5001, 50)
#asynSetTraceMask("XPS_AUX1", 0, 255)
#asynSetTraceIOMask("XPS_AUX1", 0, 2)

# asyn port, driver name, controller index, max. axes)
drvAsynMotorConfigure("XPS1", "motorXPS", 0, 3)
XPSInterpose("XPS1")

# card,  axis, groupName.positionerName
XPSConfigAxis(0,0,"GROUP1.POSITIONER",20480)
XPSConfigAxis(0,1,"GROUP2.POSITIONER1",6768)
XPSConfigAxis(0,2,"GROUP2.POSITIONER2",20480)

#asynSetTraceMask newport-xps3:5001:0   0 255
#asynSetTraceIOMask newport-xps3:5001:0 0 2
#asynSetTraceMask newport-xps3:5001:1   0 255
#asynSetTraceIOMask newport-xps3:5001:1 0 2
#asynSetTraceMask XPS1 0 255
#asynSetTraceIOMask XPS1 0 2
#asynSetTraceMask XPS1 1 255
#asynSetTraceIOMask XPS1 1 2
#asynSetTraceMask XPS1 2 255
#asynSetTraceIOMask XPS1 2 2
#asynSetTraceMask newport-xps3:5001:3   0 255
#asynSetTraceIOMask newport-xps3:5001:3 0 2

dbLoadRecords("$(MOTOR)/motorApp/Db/trajectoryScan.db", "P=IOC:,R=traj1,NAXES=2,NELM=2000,NPULSE=2000,DONPV=13LAB:str:EraseStart,DONV=1,DOFFPV=13LAB:str:StopAll,DOFFV=1")

iocInit

seq(XPS_trajectoryScan,"P=IOC:,R=traj1,M1=m2,M2=m3,IPADDR=164.54.160.34,PORT=5001,GROUP=GROUP2,P1=POSITIONER1,P2=POSITIONER2")

