neural_krobus
neural_krobus

Reputation: 91

Python script crashes when I run opc.write () using OpenOpc

I am making a python program to write variables to an opc DA server.

I have the connection and others, but when trying to write values ​​for a variable, the program does not respond and a windows error message appears saying:

this is the error i recive

My code:

import OpenOPC import sys

opc = OpenOPC.client()
servers = opc.servers()

idServer = int(2)
print('connecting to opc server:', servers[idServer])
opc.connect(servers[idServer])
print('connection okey:', servers[idServer])

write = opc.write(('variableName', 1))
print('write:', write)
input('> ')

Does anyone know why the program crashes when it reaches that part? Thanks a lot

Upvotes: 2

Views: 168

Answers (0)

Related Questions