Closedown

This commit is contained in:
gobbo_a
2017-09-20 10:31:40 +02:00
parent ccac111e4f
commit c57c9343a8
2 changed files with 26 additions and 4 deletions
+1 -1
View File
@@ -18,4 +18,4 @@ adc_xh1=ch.psi.pshell.epics.ChannelInteger|SARFE10-PBPG050:HAMP-014-x-h1-DATA-SU
adc_yh2=ch.psi.pshell.epics.ChannelInteger|SARFE10-PBPG050:HAMP-011-y-h2-DATA-SUM|||true
m2rx=ch.psi.pshell.epics.Motor|SAROP21-OOMV096:W_RX|||true
#camtool=ch.psi.pshell.bs.Camtool|localhost:10000|||
invalid=ch.psi.pshell.epics.ChannelDouble|SARUN15-UIND030:INVALID-PV -1 true Nullify|||true
invalid1=ch.psi.pshell.epics.ChannelDouble|SARUN15-UIND030:INVALID-PV -1 true Nullify|||true
+25 -3
View File
@@ -1,11 +1,33 @@
import ch.psi.pshell.epics.ChannelDouble as ChannelDouble
#Creating a timestamped channel (timestamp from the IOC) and accessing the severity
channel = ChannelDouble("test_inv1", "SARUN15-UIND030:INVALID-PV", -1, True)
add_device(channel, True)
print "Value=", test_inv1.read()
print "Severity=", val.severity
channel = ChannelDouble("test_inv", "SARUN15-UIND030:INVALID-PV", -1, True, InvalidValueAction.Nullify)
avg = create_averager(channel, 5, interval = -1, name = "avg")
avg.monitored = True
#Creating a channel with PC timestamp from the IOC and accessing the severity atomically
channel = ChannelDouble("test_inv2", "SARUN15-UIND030:INVALID-PV", -1, False, InvalidValueAction.None)
add_device(channel, True)
channel.read()
val = channel.takeTimestamped()
print "Value=", val.value
print "Timestamp=", val.timestamp
print "Severity=", val.severity
#Creating a channel nullifying the invalid values and averaging next valid values in 5 following monitor values
channel = ChannelDouble("test_inv3", "SARUN15-UIND030:INVALID-PV", -1, False, InvalidValueAction.Nullify)
channel.monitored = True
avg = create_averager(channel, 5, interval = -1, name = "test_avg_1")
add_device(channel, True)
add_device(avg, True)
#Creating a channel ignoring the invalid values and an averager averaging next 5 valid monitor values.
channel = ChannelDouble("test_inv4", "SARUN15-UIND030:INVALID-PV", -1, False, InvalidValueAction.Exception)
channel.monitored = True
avg = create_averager(channel, 5, interval = -1, name = "test_avg_2")
add_device(channel, True)
add_device(avg, True)