This commit is contained in:
boccioli_m
2015-09-02 10:39:31 +02:00
parent 3936d45b5e
commit 79e9aac763
748 changed files with 684 additions and 53722 deletions

View File

@@ -0,0 +1,31 @@
"""
EPICS direct channel access.
EPICS devices implemented are included in PShell, package ch.psi.pshell.epics.
However direct channel access builtin functions are available.
"""
channel_name = "TESTIOC:TESTCALCOUT:Output"
#reading/writing to a channel
print (caget(channel_name))
caput(channel_name, 0.0)
#Put with no wait
caput(channel_name, 0.0)
print (caget(channel_name))
#waiting for a channel valur
cawait(channel_name, 0.0, timeout = 10.0)
#If many IO it is better to keep the same CA connection
channel = Channel(channel_name, 'd')
for i in range(100):
print channel.get()
lscan(channel, (ai2,channel), 0, 10, 0.1)
#The channel class implements Readable and Writable and therefore can be used in scans
lscan(channel, ai2, 0, 10, 0.1)
#Or else we can use a Device
import ch.psi.pshell.epics.ChannelDouble as ChannelDouble
channel = ChannelDouble("My Channel", channel_name)
channel.initialize()