У меня работает Matrikon OPC Simulation server
, и я подключаюсь к нему с помощью OpenOPC .Я могу легко подключиться к нему и вывести список имитируемого элемента, но я не могу прочитать значение из них.
Если я запускаю opc.list('Simulation Items')
, я получаю ответ ниже:
['Random.ArrayOfReal8', 'Random.ArrayOfString', 'Random.Boolean', 'Random.Int1', 'Random.Int2', 'Random.Int4', 'Random.Money', 'Random.Qualities', 'Random.Real4', 'Random.Real8', 'Random.String', 'Random.Time', 'Random.UInt1', 'Random.UInt2', 'Random.UInt4']
Iя пытаюсь прочитать boolean
значение, чтобы я запустил:
opc.read('Simulation Items.Random.Boolean')
Но выдает ошибку ниже:
Traceback (most recent call last):
File "<pyshell#42>", line 1, in <module>
opc.read('Simulation Items.Random.Boolean')
File "C:\Python3.6.8(32 bit)\lib\site-packages\OpenOPC.py", line 623, in read
return list(results)[0]
File "C:\Python3.6.8(32 bit)\lib\site-packages\OpenOPC.py", line 574, in iread
if tag in include_error and not error_msgs:
TypeError: argument of type 'bool' is not iterable
Как я могу прочитать значения моделируемых элементов, используя OpenOPC
.Пожалуйста помоги.Спасибо