updated for new version of PyComm

This commit is contained in:
Patrick McDonagh
2016-03-30 16:57:25 -05:00
parent 00af9f0144
commit 8682ab8386
2 changed files with 5 additions and 5 deletions

View File

@@ -3,6 +3,7 @@
import os
import sys
import sqlite3 as lite
from pycomm.ab_comm.clx import Driver as ClxDriver
con = lite.connect("/mnt/usb/data.db")
PLC_IP_ADDRESS = "192.168.1.10"
@@ -28,10 +29,9 @@ def main(tagName):
global PLC_IP_ADDRESS
getPLCIP()
#PYCOMM Connection to PLC
from pycomm.ab_comm.clx import Driver as ClxDriver
c = ClxDriver(True, 'ClxDriver.log')
c = ClxDriver()
def readString(tag):
read_vals = c.read_array(tag, 82)

View File

@@ -28,7 +28,7 @@ def getPLCIP():
def readTag(tagName):
global PLC_IP_ADDRESS
c = ClxDriver(True, 'ClxDriver.log')
c = ClxDriver()
def readString(tag):
read_vals = c.read_array(tag, 82)
@@ -66,7 +66,7 @@ def main(tag, value):
value = int(value)
elif tagType == "REAL":
value = float(value)
c = ClxDriver(True, 'ClxDriver.log')
c = ClxDriver()
if c.open(PLC_IP_ADDRESS):
r = c.write_tag(tag, value, tagType)
else: