Fixes ipp reading from Micro800 using class instances

This commit is contained in:
Patrick McDonagh
2016-07-15 17:00:22 -05:00
parent d1440a9a36
commit 0f0bbdd061
2 changed files with 4 additions and 6 deletions

View File

@@ -2,13 +2,13 @@
import threading
import time
import pickle
from device_base import deviceBase
import micro800 as u800
addr = '10.20.4.5'
channels = {}
class Channel():
def read(self):
valData = u800.readMicroTag(self.device_addr, self.tag)
@@ -54,13 +54,11 @@ class Channel():
self.e300_param = e300_param
self.read()
def write(self, val, handshake=None, handshake_val=None):
if self.writeable:
h = handshake
hval = handshake_val
if h == None:
if h is None:
if u800.writeMicroTag(self.device_addr, self.tag, val, handshake=self.tag, handshake_val=val):
self.sendFn(self.name, val, time.time())
self.last_value = val

View File

@@ -3,14 +3,14 @@ import sys
def readMicroTag(addr, tag):
addr = str(addr)
tag = str(tag)
c = u800Driver()
if c.open(addr, True):
try:
v = c.read_tag(tag)
# print(v)
return v
except Exception:
err = c.get_status()
c.close()