45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
dispatcher.config.validationInconsistency = dispatcher.config.Inconsistency.keep_as_is
|
|
#dispatcher.config.validationInconsistency = dispatcher.config.Inconsistency.adjust_global
|
|
|
|
import ch.psi.pshell.bs.StreamChannel as StreamChannel
|
|
def bsget(channel, modulo=StreamChannel.DEFAULT_MODULO, offset=StreamChannel.DEFAULT_OFFSET, timeout = 5.0):
|
|
"""Reads an values a bsread stream, using the default provider.
|
|
|
|
Args:
|
|
channel(str or list of str): channel name(s)
|
|
module(int, optional): stream modulo
|
|
offset(int, optional): stream offset
|
|
timeout(float, optional): stream timeout in secs
|
|
Returns:
|
|
BS value or list of values
|
|
"""
|
|
channels = to_list(channel)
|
|
ret = Stream.readChannels(channels, modulo, offset, int(timeout * 1000))
|
|
if is_string(channel):
|
|
return ret[0]
|
|
return ret
|
|
|
|
|
|
run ("Tools/dispatcher")
|
|
|
|
channel = "SATMA02-RLLE-DSP:PHASE-VS"
|
|
channel = "S10CB01-RLLE-DSP:PHASE-VS"
|
|
print get_dispatcher_channel_modulo(channel)
|
|
|
|
|
|
ch = get_dispatcher_channels("PHASE-VS")
|
|
|
|
for c in ch:
|
|
print c["name"],c.get("modulo")
|
|
|
|
print bsget(channel)
|
|
|
|
|
|
|
|
st1 = Stream("st1", dispatcher)
|
|
s1=st1.addScalar(channel,channel)
|
|
st1.initialize()
|
|
try:
|
|
bscan (st1, 10, title="bscan")
|
|
finally:
|
|
st1.close() |