Beispiel #1
0
#!/usr/bin/env python

from __future__ import print_function

from pvaccess import Channel

print('****************************')
print('Testing string')
c = Channel('string01')
oldValue = c.get().getString()
print('Got old value: ', oldValue)
value = oldValue + '; a'
print('Putting value: ', value)
c.putString(value) 
newValue = c.get().getString()
print('Got new value: ', newValue)
assert newValue == value

value = oldValue + '; b'
print('Putting value: ', value)
c.put(value) 
newValue = c.get().getString()
print('Got new value: ', newValue)
assert newValue == value

print()
print('****************************')
print('Testing byte')
c = Channel('byte01')
oldValue = ord(c.get().getByte())
print('Got old value: ', oldValue)