Removed logging since it takes up lots of space
This commit is contained in:
@@ -11,7 +11,7 @@ from datetime import datetime
|
||||
import time
|
||||
import sqlite3 as lite
|
||||
from pycomm.ab_comm.clx import Driver as ClxDriver
|
||||
import logging
|
||||
# import logging
|
||||
import traceback
|
||||
|
||||
con = lite.connect("/mnt/usb/data.db")
|
||||
@@ -31,11 +31,11 @@ def readConfig():
|
||||
|
||||
|
||||
def readTag(addr, tag):
|
||||
logging.basicConfig(
|
||||
filename="clx.log",
|
||||
format="%(levelname)-10s %(asctime)s %(message)s",
|
||||
level=logging.DEBUG
|
||||
)
|
||||
# logging.basicConfig(
|
||||
# filename="clx.log",
|
||||
# format="%(levelname)-10s %(asctime)s %(message)s",
|
||||
# level=logging.DEBUG
|
||||
# )
|
||||
c = ClxDriver()
|
||||
if c.open(addr):
|
||||
try:
|
||||
@@ -52,7 +52,7 @@ def readTag(addr, tag):
|
||||
|
||||
|
||||
def readArray(addr, arr, length):
|
||||
logging.basicConfig(filename="clx.log", format="%(levelname)-10s %(asctime)s %(message)s", level=logging.DEBUG)
|
||||
# logging.basicConfig(filename="clx.log", format="%(levelname)-10s %(asctime)s %(message)s", level=logging.DEBUG)
|
||||
c = ClxDriver()
|
||||
if c.open(addr):
|
||||
try:
|
||||
|
||||
@@ -93,7 +93,7 @@ def writeTagAndVerify(tag,value, sleepValue=2):
|
||||
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)
|
||||
sleep(float(sleepValue))
|
||||
|
||||
Reference in New Issue
Block a user