Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Updated OPC-UA Read
Browse files Browse the repository at this point in the history
  • Loading branch information
Destination2Unknown committed Nov 29, 2022
1 parent e3cf647 commit 5414b02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions pytuneOPC/pidlogger/plclogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ def Record():
else:
current_date_time = datetime.utcnow().strftime('%d-%m-%Y %H:%M:%S.%f')
try:
#Setup tags to read
actualpv=round(gData.PID_PV.read_value(),2)
#Setup tags to read
retOPC=gData.comm.read_values((gData.PID_PV,gData.PID_CV,gData.PID_SP))
actualpv=round(retOPC[0],2)
pvtext.set(actualpv)
actualcv=round(gData.PID_CV.read_value(),2)
actualcv=round(retOPC[1],2)
cvtext.set(actualcv)
actualsp=round(gData.PID_SP.read_value(),2)
actualsp=round(retOPC[2],2)
sptext.set(actualsp)
#If successful increment read counter
gData.ReadCount+=1
Expand Down
7 changes: 4 additions & 3 deletions pytuneOPC/plcpidsim/plcsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ def thread_start():

def start():
try:
#Setup tags to read
actualcv=round(gData.PID_CV.read_value(),2)
#Setup tags to read
retOPC=gData.comm.read_values((gData.PID_CV,gData.PID_SP))
actualcv=round(retOPC[0],2)
cvtext.set(actualcv)
actualsp=round(gData.PID_SP.read_value(),2)
actualsp=round(retOPC[1],2)
sptext.set(actualsp)

#Send CV to Process
Expand Down

0 comments on commit 5414b02

Please sign in to comment.