Fixes ipp reading from Micro800 using class instances
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user