dispatch - python: create 2 com objects -
i need connect remotely 2 instruments using win32com, error when second object created. code looks this:
scope1 = win32com.client.dispatch("lecroy.activedsoctrl.1") #creates first instance of activedso control scope1.makeconnection("gpib:5") #connects device via gpib scope2 = win32com.client.dispatch("lecroy.activedsoctrl.2") #creates second instance of activedso control scope2.makeconnection("ip:127.0.0.1") #connects oscilloscope on local host
i error @ second com object creation. know how make work if it's possible @ all?
for benefit of others remote controlling instruments, solution simpler expected: scope1 = win32com.client.dispatch("lecroy.activedsoctrl.1") #creates first instance of activedso control
scope1.makeconnection("gpib:5") #connects device via gpib scope2 = win32com.client.dispatch("lecroy.activedsoctrl.1") #creates second instance of activedso control
scope2.makeconnection("ip:127.0.0.1") #connects oscilloscope on local host or other ip address
i can create many activex object want, long keep using same reference in dispatch: "lecroy.activedsoctrl.1"
generator = win32com.client.dispatch("lecroy.activedsoctrl.1")
multimeter= win32com.client.dispatch("lecroy.activedsoctrl.1") . .
my mistake use .2 has no reference.
Comments
Post a Comment