Professional OPC
Development Tools


Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Read ad Write multiple values

20 Feb 2024 17:41 #12566 by support
Examples for OPC client and subscriber development in Python are now on GitHub: .

Please Log in or Create an account to join the conversation.

21 Nov 2023 13:35 #12397 by support
Note: QuickOPC now supports Python in much better way, cleaner syntax, and public packages ( on Python Package Index . See What's new in QuickOPC 2023.2 for more information. And, over 270 examples are available in the User's Guide!

Please Log in or Create an account to join the conversation.

20 Aug 2019 06:11 #7634 by support

It looks like that we have worked on similar issue in Python before. The results array is weird - but it still can be processed. Please see , and attempt to extract the results (roughly) like this:

Result1 = win32com.client.Dispatch(val[0][0])
Result2 = win32com.client.Dispatch(val[0][1])
Result3 = win32com.client.Dispatch(val[0][2])
Vtq1 = Result1.Vtq
Vtq2 = Result2.Vtq
Vtq3 = Result3.Vtq
Best regards

Please Log in or Create an account to join the conversation.

17 Aug 2019 20:03 #7632 by Jesus Rodriguez
Hi, thanks for your reply, I just tried to run it in python. This is what I got:

import win32com.client

ReadItemArguments1 = win32com.client.Dispatch("OpcLabs.EasyOpc.DataAccess.OperationModel.DAReadItemArguments")
ReadItemArguments1.ServerDescriptor.ServerClass = "OPCLabs.KitServer.2"
ReadItemArguments1.ItemDescriptor.ItemID = "Demo.Single"

ReadItemArguments2 = win32com.client.Dispatch("OpcLabs.EasyOpc.DataAccess.OperationModel.DAReadItemArguments")
ReadItemArguments2.ServerDescriptor.ServerClass = "OPCLabs.KitServer.2"
ReadItemArguments2.ItemDescriptor.ItemID = "Demo.Single"

arguments = [ReadItemArguments1, ReadItemArguments2]

client = win32com.client.Dispatch('OpcLabs.EasyOpc.DataAccess.EasyDAClient')

results = client.ReadMultipleItemValues(arguments)

There is no error at this point but still I think is not correct since I cannot get the values.

Thank you for your help

Please Log in or Create an account to join the conversation.

14 Aug 2019 07:51 #7621 by support
There are ReadMultipleItems and ReadMultipleItemValues methods for this purpose. See e.g. .

I do not have Python example at hand. hopefully you can derive it from code given in other languages. If you run into an issue, let me know here. Here is a VBScript example for ReadMultipleItemValues:
Rem This example shows how to read values of 4 items at once, and display them.
Option Explicit
Dim ReadItemArguments1: Set ReadItemArguments1 = CreateObject("OpcLabs.EasyOpc.DataAccess.OperationModel.DAReadItemArguments")
ReadItemArguments1.ServerDescriptor.ServerClass = "OPCLabs.KitServer.2"
ReadItemArguments1.ItemDescriptor.ItemID = "Simulation.Random"
Dim ReadItemArguments2: Set ReadItemArguments2 = CreateObject("OpcLabs.EasyOpc.DataAccess.OperationModel.DAReadItemArguments")
ReadItemArguments2.ServerDescriptor.ServerClass = "OPCLabs.KitServer.2"
ReadItemArguments2.ItemDescriptor.ItemID = "Trends.Ramp (1 min)"
Dim ReadItemArguments3: Set ReadItemArguments3 = CreateObject("OpcLabs.EasyOpc.DataAccess.OperationModel.DAReadItemArguments")
ReadItemArguments3.ServerDescriptor.ServerClass = "OPCLabs.KitServer.2"
ReadItemArguments3.ItemDescriptor.ItemID = "Trends.Sine (1 min)"
Dim ReadItemArguments4: Set ReadItemArguments4 = CreateObject("OpcLabs.EasyOpc.DataAccess.OperationModel.DAReadItemArguments")
ReadItemArguments4.ServerDescriptor.ServerClass = "OPCLabs.KitServer.2"
ReadItemArguments4.ItemDescriptor.ItemID = "Simulation.Register_I4"
Dim arguments(3)
Set arguments(0) = ReadItemArguments1
Set arguments(1) = ReadItemArguments2
Set arguments(2) = ReadItemArguments3
Set arguments(3) = ReadItemArguments4
Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.DataAccess.EasyDAClient")
Dim results: results = Client.ReadMultipleItemValues(arguments)
Dim i: For i = LBound(results) To UBound(results)
    WScript.Echo "results(" & i & ").Value: " & results(i).Value

Best regards

Please Log in or Create an account to join the conversation.

13 Aug 2019 05:36 #7620 by admin
Replied by admin on topic Read ad Write multiple values
Please be [patient. Will reply later this week, as soon as possible. We have a vacation period.

Please Log in or Create an account to join the conversation.

12 Aug 2019 18:26 #7619 by Jesus Rodriguez

I have the following code to read and write:

import win32com.client
client = win32com.client.Dispatch('OpcLabs.EasyOpc.DataAccess.EasyDAClient')

value = client.ReadItemValue('', 'CoDeSys.OPC.02', '.Inputs[9]')
client.WriteItemValue('', 'CoDeSys.OPC.02', '.Inputs[9]', 7)

They work well but I would like to know how to read and write multiple values in just one function. Is there any function already doing this?

Thank you.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.056 seconds