Using IVI-COM drivers with python via comtypes
<p>I am trying to get my IVI drivers working using comtypes. So far I have been successful in initializing the instrument thanks to <a href="http://stackoverflow.com/questions/13840997/python-instrument-drivers">Python instrument drivers</a>
more specifically Jorenko's post, as he is using the same instrument as me (I'm hoping he sees this as he seems to work for the company that makes the instrument).</p>

<p>So far I have:</p>

<pre><code>from comtypes import client
dmm = client.CreateObject('VTEXDmm.VTEXDmm')
dmm.Initialize('TCPIP::10.20.30.40::INSTR', True, True)
dmm.Initiate()
dmm.Measurement.Read(1000)
#dmm.Measurement.Fetch(1000)
</code></pre>

<p>This works fine for taking readings from the default state, which is DC Volts, but I can't figure out how to set other functions.
I've tried</p>

<pre><code>dmm.Function = VTEXDmmFunctionACVolts
</code></pre>

<p>and had no joy with it.</p>

<p>It's worth noting that I have very little experience with IVI drivers.</p>

<p>Can someone please point me in the right direction</p>

<p>Thanks</p>

<p>Answered my own question (after much trial and error)</p>

<p>For anyone interested, I had a bit of success with the following</p>

<pre><code>import comtypes 
from comtypes import client
dmm = client.CreateObject('VTEXDmm.VTEXDmm')
dmm.Initialize('TCPIP::10.20.30.40::INSTR', True, True)
dmm.Configure(Function=comtypes.gen.VTEXDmmLib.VTEXDmmFunctionACVolts, Range=1.0, Resolution=0.0001)
dmm.Initiate()
dmm.Measurement.Read(1000)
</code></pre>

python com driver visa