Generation working and Compilation of MARTe components
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import time
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
#
|
||||
# Some EPICS PVs need to be simulation mode when we test code without PXI board.
|
||||
# When user uses sim mode, new value must be written into PV.SVAL and PV itselfself.
|
||||
#
|
||||
print '### Start State Machine Sequence Test ###'
|
||||
|
||||
def test_setup():
|
||||
"""
|
||||
Setup EPICS PVs for testing.
|
||||
Turn simulation mode ON for unavailable device
|
||||
"""
|
||||
print '---------- Start setup for the test ----------'
|
||||
|
||||
print '1. set PVs to simulation mode'
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-AI-SIMM YES', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GBF:STAT-AI-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-DI-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF:STAT-DI-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-MCPS:STAT-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-MCPS:STAT-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-GCPS:STAT-SIMM YES', shell=True) #turn off for GCPS test.
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-GCPS:STAT-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-CCPS:STAT-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-CCPS:STAT-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAF-FHPS:STAT-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBF-FHPS:STAT-SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:PSU3000-YFLT.SCAN Passive', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:PSU3000-YFLT.SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:PSU3000-YFLT.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:PSU3000-YFLT 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:PSU1000-YFLT.SCAN Passive', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:PSU1000-YFLT.SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:PSU1000-YFLT.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:PSU1000-YFLT 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA2F:PSU4000-YFLT.SCAN Passive', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA2F:PSU4000-YFLT.SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA2F:PSU4000-YFLT.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA2F:PSU4000-YFLT 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB2F:PSU2000-YFLT.SCAN Passive', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB2F:PSU2000-YFLT.SIMM YES', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB2F:PSU2000-YFLT.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB2F:PSU2000-YFLT 0', shell=True)
|
||||
time.sleep(1)
|
||||
print '2. Change SCAN mode from I/O Inter to Passive to write sumulated values.'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY1.SCAN Passive', shell=True)#SELECT
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-OPGY2.SCAN Passive', shell=True)#SELECT
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST1R.SCAN Passive', shell=True) #STANDBY
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST2R.SCAN Passive', shell=True) #READY
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SCAN Passive', shell=True) #ON
|
||||
res = subprocess.call('caput EC-GN-P01-PMF:PSU0000-TYSTA.SCAN Passive', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PA1F:PSU3000-YSTA.SCAN Passive', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-PB1F:PSU1000-YSTA.SCAN Passive', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SCAN Passive', shell=True) #PERMIT
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SCAN Passive', shell=True) #PERMIT
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SCAN Passive', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD2.SCAN Passive', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD3.SCAN Passive', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD4.SCAN Passive', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS.SCAN Passive', shell = True) #SYNC/ASYNC
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YON-CCPS1.SCAN Passive', shell=True) #CCPS ON REQUEST
|
||||
time.sleep(1)
|
||||
print '3. Set pulse length limit mode value and state.'
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 10000', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD2-LIM 100000', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD3-LIM 1000000', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD4-LIM 10000000', shell = True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD2.SVAL 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD2 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD3.SVAL 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD3 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD4.SVAL 0', shell = True) #Pulse lenght mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD4 0', shell = True) #Pulse lenght mode
|
||||
print '4. Set other operation modes'
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-PREP-MODE 0', shell = True) #Pre-pro mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS.SVAL 0', shell = True) #SYNC/ASYNC mode
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YSTA-MPSS 0', shell = True) #SYNC/ASYNC mode
|
||||
res = subprocess.call('caput EC-GN-P01-GAF:STAT-SHORT-PULSE 0',shell = True) #Short pulse mode
|
||||
time.sleep(1)
|
||||
print '5. Set a beam-on schedule(10ms diff + 100ms pulse)'
|
||||
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 10000', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 20000', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 30000', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 40000', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 50000', shell=True)
|
||||
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 100000', shell=True)
|
||||
time.sleep(1)
|
||||
print '6. Reset PLC INTERLOCK'
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTRP.SIMM 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTRP.SCAN 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTRP.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTRP 0', shell=True) #CCPS_IS_OPERATION
|
||||
res = subprocess.call('caput EC-GN-P01-GAFP:FMC4310-YTRP.SIMM 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAFP:FMC4310-YTRP.SCAN 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAFP:FMC4310-YTRP.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GAFP:FMC4310-YTRP 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBFP:FMC4310-YTRP.SIMM 1', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBFP:FMC4310-YTRP.SCAN 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBFP:FMC4310-YTRP.SVAL 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GBFP:FMC4310-YTRP 0', shell=True)
|
||||
res = subprocess.call('caput EC-GN-P01-GPF:STAT-RST-FLT 1', shell=True)
|
||||
print '---------- END setup for the test ----------'
|
||||
@@ -0,0 +1,231 @@
|
||||
record (bo,"EC-GN-P01-PMF:PSU0000-COFF")
|
||||
{
|
||||
field(DESC, "MHVPS Shutdown request")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-PMF:PSU0000-CON-MOD")
|
||||
{
|
||||
field(DESC, "MHVPS MOD Enable/Disable")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-PMF:PSU0000-CON-SW")
|
||||
{
|
||||
field(DESC, "MHVPS Enable/Disable")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DO-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-PMF:PSU0000-TYSTA")
|
||||
{
|
||||
field(DESC, "MHVPS Ready status")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 7) bitread")
|
||||
field(ONAM, "READY")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "NO")
|
||||
}
|
||||
|
||||
record (bi,"EC-GN-P01-PMF:PSU0000-YFLT")
|
||||
{
|
||||
field(DESC, "MHVPS Fast Protection Act")
|
||||
field(DTYP, "asynInt32")
|
||||
field(INP, "@asyn(ni6528_1, 6) bitread")
|
||||
field(ONAM, "FAULT")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "I/O Intr")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-DI-SIMM")
|
||||
field(VAL, "0")
|
||||
field(ZNAM, "NORMAL")
|
||||
}
|
||||
|
||||
record (bo,"EC-GN-P01-PMF:STAT-MANM")
|
||||
{
|
||||
field(DESC, "Manual Mode SW for GY1 APS")
|
||||
field(ONAM, "ON")
|
||||
field(PINI, "YES")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "1")
|
||||
field(ZNAM, "OFF")
|
||||
}
|
||||
|
||||
record (ao,"EC-GN-P01-PMF:PSU0000-EREF")
|
||||
{
|
||||
field(ASLO, "11")
|
||||
field(DESC, "MHVPS voltage setpoint")
|
||||
field(DRVH, "55")
|
||||
field(DRVL, "0")
|
||||
field(DTYP, "asynFloat64")
|
||||
field(EGU, "kV")
|
||||
field(HOPR, "55")
|
||||
field(LOPR, "0")
|
||||
field(OUT, "@asyn(ni6368_1, 3) write_ao")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "2")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AO-SIMM")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (ao,"EC-GN-P01-PMF:PSU0000-EREF-MSP")
|
||||
{
|
||||
field(DESC, "MHVPS voltage manual setpoint")
|
||||
field(DRVH, "55")
|
||||
field(DRVL, "0")
|
||||
field(EGU, "kV")
|
||||
field(HOPR, "55")
|
||||
field(LOPR, "0")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "2")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "0")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-PMF:PSU0000-ET-GA")
|
||||
{
|
||||
field(DESC, "GY1 MHVPS Measued Voltage")
|
||||
field(EGU, "kV")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-PMF:PSU0000-ET-GA-WF")
|
||||
{
|
||||
field(DESC, "GY1 MHVPS Measued Voltage")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-PMF:PSU0000-ET-GB")
|
||||
{
|
||||
field(DESC, "GY2 MHVPS Measued Voltage")
|
||||
field(EGU, "kV")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-PMF:PSU0000-ET-GB-WF")
|
||||
{
|
||||
field(DESC, "GY2 MHVPS Measued Voltage")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-PMF:PSU0000-IT-GA")
|
||||
{
|
||||
field(DESC, "GY1 MHVPS Measured Current")
|
||||
field(EGU, "A")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-PMF:PSU0000-IT-GA-WF")
|
||||
{
|
||||
field(DESC, "GY1 MHVPS Measured Current")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GAF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-PMF:PSU0000-IT-GB")
|
||||
{
|
||||
field(DESC, "GY2 MHVPS Measured Current")
|
||||
field(EGU, "A")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, ".1 second")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-PMF:PSU0000-IT-GB-WF")
|
||||
{
|
||||
field(DESC, "GY2 MHVPS Measured Current")
|
||||
field(EGU, "A")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "3")
|
||||
field(SCAN, "Passive")
|
||||
field(SIML, "EC-GN-P01-GBF:STAT-AI-SIMM")
|
||||
}
|
||||
|
||||
record (ai,"EC-GN-P01-PMF:STAT-DT-HVON")
|
||||
{
|
||||
field(DESC, "Time diff to MHVPS ON")
|
||||
field(EGU, "us")
|
||||
field(HOPR, "5000000")
|
||||
field(LOPR, "1000")
|
||||
field(PINI, "YES")
|
||||
field(PREC, "0")
|
||||
field(SCAN, "Passive")
|
||||
field(VAL, "500000")
|
||||
}
|
||||
|
||||
record (calcout,"EC-GN-P01-PMF:STAT-EREF-CALC")
|
||||
{
|
||||
field(CALC, "(A!=C)?A:((B!=D)?B:E);C:=A; D:=B")
|
||||
field(DESC, "determine MHVPS EREF change")
|
||||
field(INPE, "EC-GN-P01-PMF:PSU0000-EREF")
|
||||
field(OOPT, "On Change")
|
||||
field(OUT, "EC-GN-P01-PMF:PSU0000-EREF PP")
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
|
||||
record (calcout,"EC-GN-P01-PMF:STAT-HVON-CALC")
|
||||
{
|
||||
field(CALC, "(A||B)?1:0")
|
||||
field(DESC, "determine MHVPS HVON change")
|
||||
field(OOPT, "On Change")
|
||||
field(OUT, "EC-GN-P01-PMF:PSU0000-CON-SW PP")
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
|
||||
record (waveform,"EC-GN-P01-PMF:STAT-PREP-WF")
|
||||
{
|
||||
field(DESC, "MHVPS prepro schedule")
|
||||
field(EGU, "V")
|
||||
field(FTVL, "FLOAT")
|
||||
field(NELM, "8000")
|
||||
field(PINI, "NO")
|
||||
field(PREC, "2")
|
||||
field(SCAN, "Passive")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user