Generation working and Compilation of MARTe components

This commit is contained in:
ferrog
2025-05-13 16:03:11 +00:00
parent 3a5e378d99
commit 4faee3802a
1571 changed files with 611466 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
#############################################################
#
# Copyright 2015 F4E | European Joint Undertaking for ITER
# and the Development of Fusion Energy ('Fusion for Energy')
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (the "Licence");
# You may not use this work except in compliance with the
# Licence.
# You may obtain a copy of the Licence at:
#
# http://ec.europa.eu/idabc/eupl
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the Licence is
# distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied.
# See the Licence for the specific language governing
# permissions and limitations under the Licence.
#
# $Id: Makefile.inc 3 2012-01-15 16:26:07Z aneto $
#
#############################################################
OBJSX=RandomDataSource.x
PACKAGE=DataSources
ROOT_DIR=../../../obj
MAKEDEFAULTDIR=$(MARTe2_DIR)/MakeDefaults
include $(MAKEDEFAULTDIR)/MakeStdLibDefs.$(TARGET)
INCLUDES += -I.
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L0Types
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L2Objects
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L3Streams
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Messages
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L4Configuration
INCLUDES += -I$(MARTe2_DIR)/Source/Core/BareMetal/L5GAMs
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L1Portability
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L3Services
INCLUDES += -I$(MARTe2_DIR)/Source/Core/Scheduler/L4Messages
all: $(OBJS) $(SUBPROJ) \
$(BUILD_DIR)/RandomDataSource$(LIBEXT) \
$(BUILD_DIR)/RandomDataSource$(DLLEXT)
echo $(OBJS)
include $(MAKEDEFAULTDIR)/MakeStdLibRules.$(TARGET)

View File

@@ -0,0 +1,27 @@
#############################################################
#
# Copyright 2015 F4E | European Joint Undertaking for ITER
# and the Development of Fusion Energy ('Fusion for Energy')
#
# Licensed under the EUPL, Version 1.1 or - as soon they
# will be approved by the European Commission - subsequent
# versions of the EUPL (the "Licence");
# You may not use this work except in compliance with the
# Licence.
# You may obtain a copy of the Licence at:
#
# http://ec.europa.eu/idabc/eupl
#
# Unless required by applicable law or agreed to in
# writing, software distributed under the Licence is
# distributed on an "AS IS" basis,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied.
# See the Licence for the specific language governing
# permissions and limitations under the Licence.
#
# $Id: Makefile.gcc 3 2012-01-15 16:26:07Z aneto $
#
#############################################################
include Makefile.inc

View File

@@ -0,0 +1,414 @@
#!/usr/bin/python
import time
import sys
import subprocess
def test_async():
""""
Simulate permit signal and ON signal from PLC.
Confirm pulse generation with async mode. 10ms
"""
print '1.set beam-on schedule (10ms diff + 3s pulse.)'
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 10000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 20000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 30000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 40000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 50000000', shell=True)
res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 1000000', shell=True)
# turn on permit
print '2.. set PulseLengthLimitMode to 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 10000000', shell = True)
time.sleep(1)
print '3. Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
time.sleep(1)
# trun on HVON trigger
print '4. Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True) #HVON signal from PLC
time.sleep(1)
print '5. Confirm generated pulse'
print '6. Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(1)
print '7. Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
print "end of async, non-prepro mode test!"
def test_async_limit():
""""
Mode Limit Stop test.
Pulse lenght was set to 3s, but it stop in 1s because of mode limit.
"""
print '1.set beam-on schedule'
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 1000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 11000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 21000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 31000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 41000000', shell=True)
res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 3000000', shell=True)
# turn on permit
print '2.. set PulseLengthLimitMode to 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 1000000', shell = True)
time.sleep(1)
print '3. Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
time.sleep(1)
# trun on HVON trigger
print '4. Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True) #HVON signal from PLC
time.sleep(6)
print '5. Confirm generated pulse'
print '6. Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(1)
print '7. Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
print "end of async, non-prepro mode test!"
def test_async_prepro():
"""PrePro mode test"""
print '1.set beam-on schedule'
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 100000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 200000', shell=True)
res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 300000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 400000', shell=True)
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 500000', shell=True)
res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 3000000', shell=True)
print '2.. set PulseLengthLimitMode to 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 10000000', shell = True)
time.sleep(1)
print '1.Set Pre-Pro flag'
res = subprocess.call('caput EC-GN-P01-GAF:STAT-PREP-MODE 1', shell = True)
time.sleep(1)
print '2.Reset Mode 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 0', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 0', shell = True)
print '3.Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
time.sleep(2)
print '4.Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True)
time.sleep(4)
print '5.Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(3)
print '6.Reset Pre-Pro flag'
res = subprocess.call('caput EC-GN-P01-GAF:STAT-PREP-MODE 0', shell = True)
time.sleep(1)
print '7. Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
print 'end of async, prepro mode testscript!'
def test_async_shortpulse():
"""Short Pulse Mode test"""
#print '1.Set puls length to 1ms (1ms diff)'
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-SHORT-PULSE 1', shell=True) #Set short pulse mode.
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 1000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 2000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 3000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 4000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 5000', shell=True) #Should be grater than 1ms.
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 1000', shell=True)
print '1.Set puls length to 100us (100us diff)'
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-SHORT-PULSE 1', shell=True) #Set short pulse mode.
#res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 100', shell=True)
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 200', shell=True)
#res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 300', shell=True)
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 400', shell=True)
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 800', shell=True) #Should be grater than 1ms.
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 100', shell=True)
print '1.Set puls length (100us diff)'
res = subprocess.call('caput EC-GN-P01-GAF:STAT-SHORT-PULSE 1', shell=True) #Set short pulse mode.
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 100', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 200', shell=True)
res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 300', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 400', shell=True)
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 800', shell=True) #Should be grater than 1ms.
res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 500', shell=True)
print '2.Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
time.sleep(1)
print '3.Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True) #HVON signal from PLC
time.sleep(1)
print '4.Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(1)
print '5.Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
print '6.Reset short pulse mode'
res = subprocess.call('caput EC-GN-P01-GAF:STAT-SHORT-PULSE 0', shell=True) #Set short pulse mode.
print "-----------------------------------------\n"
def test_async_longpulse():
""""
Simulate permit signal and ON signal from PLC.
Confirm pulse generation with async mode. 10ms
"""
print '1.set beam-on schedule (10ms diff + 50ms 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 3600000000', shell=True)
# turn on permit
print '2.. set PulseLengthLimitMode to 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 180000000', shell = True)
time.sleep(1)
print '3. Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
time.sleep(1)
# trun on HVON trigger
print '4. Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True) #HVON signal from PLC
time.sleep(185)
print '5. Confirm generated pulse'
print '6. Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(1)
print '7. Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
print "end of async, non-prepro mode test!"
def test_async_both():
""""
Simultanious operation test.
"""
print '1.set beam-on schedule (10ms diff + 500ms 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 500000', shell=True)
res = subprocess.call('caput EC-GN-P01-PA2F:STAT-DT-HVON 10000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB2F:STAT-DT-HVON 20000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB2F:STAT-DT-SWON 40000', shell=True)
res = subprocess.call('caput EC-GN-P01-PA2F:STAT-DT-SWON 50000', shell=True)
res = subprocess.call('caput EC-GN-P01-GBF:STAT-DT-SHOTLEN 500000', shell=True)
# turn on permit
print '2.. set PulseLengthLimitMode to 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 1000000', shell = True)
time.sleep(1)
print '3. Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM 1', shell=True)
time.sleep(1)
# trun on HVON trigger
print '4. Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True) #HVON signal from PLC
time.sleep(1)
print '5. Confirm generated pulse'
print '6. Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(1)
print '7. Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM 0', shell=True)
print "end of async, non-prepro mode test!"
def test_async_GYA():
""""
Test GYA operation with Async mode.
"""
#print '1.set beam-on schedule (1s diff + 1s pulse.)'
#print '1.set beam-on schedule (100ms diff + 1s pulse.)'
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 100000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 200000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 300000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 400000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 500000', shell=True)
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 1000000', shell=True)
#print '1.set 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)
#print '1.set beam-on schedule (1ms diff + 10ms pulse.)'
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 1000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 2000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 3000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 4000', shell=True)
#res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 5000', shell=True)
#res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 10000', shell=True)
print '1.set beam-on schedule (1s diff + 20s pulse.)'
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-HVON 1000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-HVON 2000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 3000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB1F:STAT-DT-SWON 4000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PA1F:STAT-DT-SWON 5000000', shell=True)
res = subprocess.call('caput EC-GN-P01-GAF:STAT-DT-SHOTLEN 20000000', shell=True)
# turn on permit
print '2.. set PulseLengthLimitMode to 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 1000000', shell = True)
time.sleep(1)
print '3. Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
time.sleep(1)
# trun on HVON trigger
print '4. Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True) #HVON signal from PLC
time.sleep(30)
print '5. Confirm generated pulse'
print '6. Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(1)
print '7. Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
print "end of async, non-prepro mode test!"
def test_async_GYB():
""""
Test GYB operation with Async mode.
"""
print '1.set beam-on schedule (1s diff + 1s pulse.)'
res = subprocess.call('caput EC-GN-P01-PA2F:STAT-DT-HVON 1000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB2F:STAT-DT-HVON 2000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PMF:STAT-DT-HVON 3000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PB2F:STAT-DT-SWON 4000000', shell=True)
res = subprocess.call('caput EC-GN-P01-PA2F:STAT-DT-SWON 5000000', shell=True)
res = subprocess.call('caput EC-GN-P01-GBF:STAT-DT-SHOTLEN 20000000', shell=True)
# turn on permit
print '2.. set PulseLengthLimitMode to 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 1000000', shell = True)
time.sleep(1)
print '3. Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM 1', shell=True)
time.sleep(1)
# trun on HVON trigger
print '4. Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True) #HVON signal from PLC
time.sleep(30)
print '5. Confirm generated pulse'
print '6. Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(1)
print '7. Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM 0', shell=True)
print "end of async, non-prepro mode test!"
def test_async_GYA_manual():
""""
Test GYA operation with Async mode.
"""
print '1.. Set delays and pulse length on HMI and set sleep time here:'
inp_val = raw_input()
try:
sleep_time = float(inp_val)
except:
return
# turn on permit
print '2.. set PulseLengthLimitMode to 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 1000000', shell = True)
time.sleep(1)
print '3. Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 1', shell=True)
time.sleep(1)
# trun on HVON trigger
print '4. Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True) #HVON signal from PLC
time.sleep(sleep_time)
print '5. Confirm generated pulse'
print '6. Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(1)
print '7. Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY1PRM 0', shell=True)
print "end of async, non-prepro mode test!"
def test_async_GYB_manual():
""""
Test GYA operation with Async mode.
"""
print '1.. Set delays and pulse length on HMI and set sleep time here:'
inp_val = raw_input()
try:
sleep_time = float(inp_val)
except:
return
# turn on permit
print '2.. set PulseLengthLimitMode to 1 flag'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1.SVAL 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-MD1 1', shell = True)
res = subprocess.call('caput EC-GN-P01-GPF:STAT-MD1-LIM 1000000', shell = True)
time.sleep(1)
print '3. Write PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM 1', shell=True)
time.sleep(1)
# trun on HVON trigger
print '4. Write HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 1', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 1', shell=True) #HVON signal from PLC
time.sleep(sleep_time)
print '5. Confirm generated pulse'
print '6. Reset HVON'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-YTS-ST3R 0', shell=True)
time.sleep(1)
print '7. Reset PERMIT'
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM.SVAL 0', shell=True)
res = subprocess.call('caput EC-GN-P01-GPS:PLC4110-CON-GY2PRM 0', shell=True)
print "end of async, non-prepro mode test!"

View File

@@ -0,0 +1,37 @@
#ifndef SDD_IOMODULE_H
#define SDD_IOMODULE_H
//include all linux libraries for IO module listed in the programs
//max is 15 for component name
#define SDD_CPMAXLENGTH 50
#define SDD_SERIALNBMAXLENGTH 60
#define SDD_FDPREFIXMAXLENGTH 100
struct SDD_IOModule {
//name of the module
char name[SDD_CPMAXLENGTH];
//type of the module
char modtype[SDD_CPMAXLENGTH];
//module index
int fd;
//file descriptor name
char filedescrip_prefix[SDD_FDPREFIXMAXLENGTH];
//serial number
char serial_number [SDD_SERIALNBMAXLENGTH];
};
//list of symbol for IOModule : IO module type and fd
typedef enum SDD_IOModuleEnum {
} SDD_IOModuleEnum;
#endif /* SDD_IOMODULE_H */