[python-win32] problem accessing OPC clients from thread
Tim Roberts
timr at probo.com
Tue Jan 22 19:14:12 CET 2008
caxelrud wrote:
> Hi,
> I need some help on OPC and Python (using makepy and Matrikon simulator).
> I am getting an error when trying to AddItem.
> The error is:
> The item definition doesn't conform to the server's syntax.
> OPC_E_INVALIDITEMID 0xC0040008L
>
> Any idea ?
> Thanks
> Here the code:
>
>>>> import win32com.client
>>>> opcserver=win32com.client.Dispatch('OPC.Automation.1')
>>>> opcserver.Connect('Matrikon.OPC.Simulation.1')
>>>> groups=opcserver.OPCGroups
>>>> group=groups.Add('Group1')
>>>> items=group.OPCItems
>>>> item=items.AddItem('File1.item1',1)
>>>> item=items.AddItem('File1.item1',1)
>>>>
> Traceback (most recent call last):
> File "<interactive input>", line 1, in <module>
> File "<COMObject <unknown>>", line 3, in AddItem
> com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0,
> -1073479672), None)
>
I don't know the Matrikon product at all, but I would guess that this is
because you are adding two items with exactly the same name. Does it
work if you make the second one "File1.item2"?
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list