Skip to content

Commit

Permalink
Generated gh-pages for commit dfa0f4f
Browse files Browse the repository at this point in the history
Author: lukabavdaz <[email protected]>

    Feat: Fix: Support for ivvi dac polarity and minor changes (#541)
  • Loading branch information
Documentation Bot committed Apr 24, 2017
1 parent 6fb84a0 commit 7a83a5f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
36 changes: 19 additions & 17 deletions _modules/qcodes/instrument_drivers/QuTech/IVVI.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ <h1>Source code for qcodes.instrument_drivers.QuTech.IVVI</h1><div class="highli
<span class="sd">&#39;&#39;&#39;</span>
<span class="sd"> Status: Alpha version, tested for basic get-set commands</span>
<span class="sd"> TODO:</span>
<span class="sd"> - Add individual parameters for channel polarities</span>
<span class="sd"> - Test polarities different from BIP</span>
<span class="sd"> - Add adjustable range and rate protection per channel</span>
<span class="sd"> - Add error handling for the specific error messages in the</span>
<span class="sd"> protocol</span>
Expand All @@ -196,9 +194,9 @@ <h1>Source code for qcodes.instrument_drivers.QuTech.IVVI</h1><div class="highli
<span class="n">Halfrange</span> <span class="o">=</span> <span class="n">Fullrange</span> <span class="o">/</span> <span class="mi">2</span>

<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">address</span><span class="p">,</span> <span class="n">reset</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">numdacs</span><span class="o">=</span><span class="mi">16</span><span class="p">,</span> <span class="n">dac_step</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
<span class="n">dac_delay</span><span class="o">=.</span><span class="mi">1</span><span class="p">,</span> <span class="n">dac_max_delay</span><span class="o">=</span><span class="mf">0.2</span><span class="p">,</span> <span class="n">safe_version</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="c1"># polarity=[&#39;BIP&#39;, &#39;BIP&#39;, &#39;BIP&#39;, &#39;BIP&#39;]):</span>
<span class="c1"># commented because still on the todo list</span>
<span class="n">dac_delay</span><span class="o">=.</span><span class="mi">1</span><span class="p">,</span> <span class="n">dac_max_delay</span><span class="o">=</span><span class="mf">0.2</span><span class="p">,</span> <span class="n">safe_version</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">polarity</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;BIP&#39;</span><span class="p">,</span> <span class="s1">&#39;BIP&#39;</span><span class="p">,</span> <span class="s1">&#39;BIP&#39;</span><span class="p">,</span> <span class="s1">&#39;BIP&#39;</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>

<span class="sd">&#39;&#39;&#39;</span>
<span class="sd"> Initialzes the IVVI, and communicates with the wrapper</span>

Expand All @@ -210,11 +208,11 @@ <h1>Source code for qcodes.instrument_drivers.QuTech.IVVI</h1><div class="highli
<span class="sd"> polarity (string[4]) : list of polarities of each set of 4 dacs</span>
<span class="sd"> choose from &#39;BIP&#39;, &#39;POS&#39;, &#39;NEG&#39;,</span>
<span class="sd"> default=[&#39;BIP&#39;, &#39;BIP&#39;, &#39;BIP&#39;, &#39;BIP&#39;]</span>
<span class="sd"> dac_step (float) : max step size for dac parameter</span>
<span class="sd"> dac_delay (float) : delay (in seconds) for dac</span>
<span class="sd"> dac_max_delay (float) : maximum delay before emitting a warning</span>
<span class="sd"> safe_version (bool) : if True then do not send version commands</span>
<span class="sd"> to the IVVI controller</span>
<span class="sd"> dac_step (float) : max step size for dac parameter</span>
<span class="sd"> dac_delay (float) : delay (in seconds) for dac</span>
<span class="sd"> dac_max_delay (float): maximum delay before emitting a warning</span>
<span class="sd"> safe_version (bool) : if True then do not send version commands</span>
<span class="sd"> to the IVVI controller</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="n">t0</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">address</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
Expand Down Expand Up @@ -273,14 +271,21 @@ <h1>Source code for qcodes.instrument_drivers.QuTech.IVVI</h1><div class="highli
<span class="n">label</span><span class="o">=</span><span class="s1">&#39;Dac voltages&#39;</span><span class="p">,</span>
<span class="n">get_cmd</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_get_dacs</span><span class="p">)</span>

<span class="c1">#initialize pol_num, the voltage offset due to the polarity</span>
<span class="bp">self</span><span class="o">.</span><span class="n">pol_num</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_numdacs</span><span class="p">)</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_numdacs</span><span class="o">/</span><span class="mi">4</span><span class="p">)):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">set_pol_dacrack</span><span class="p">(</span><span class="n">polarity</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">1</span><span class="o">+</span><span class="n">i</span><span class="o">*</span><span class="mi">4</span><span class="p">,</span><span class="mi">1</span><span class="o">+</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="mi">4</span><span class="p">),</span>
<span class="n">get_all</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>

<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">numdacs</span> <span class="o">+</span> <span class="mi">1</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_parameter</span><span class="p">(</span>
<span class="s1">&#39;dac</span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">i</span><span class="p">),</span>
<span class="n">label</span><span class="o">=</span><span class="s1">&#39;Dac </span><span class="si">{}</span><span class="s1"> (mV)&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">i</span><span class="p">),</span>
<span class="n">label</span><span class="o">=</span><span class="s1">&#39;Dac </span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">i</span><span class="p">),</span>
<span class="n">unit</span><span class="o">=</span><span class="s1">&#39;mV&#39;</span><span class="p">,</span>
<span class="n">get_cmd</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_gen_ch_get_func</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_get_dac</span><span class="p">,</span> <span class="n">i</span><span class="p">),</span>
<span class="n">set_cmd</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_gen_ch_set_func</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_set_dac</span><span class="p">,</span> <span class="n">i</span><span class="p">),</span>
<span class="n">vals</span><span class="o">=</span><span class="n">vals</span><span class="o">.</span><span class="n">Numbers</span><span class="p">(</span><span class="o">-</span><span class="mi">2000</span><span class="p">,</span> <span class="mi">2000</span><span class="p">),</span>
<span class="n">vals</span><span class="o">=</span><span class="n">vals</span><span class="o">.</span><span class="n">Numbers</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">pol_num</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span>
<span class="bp">self</span><span class="o">.</span><span class="n">pol_num</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">+</span><span class="bp">self</span><span class="o">.</span><span class="n">Fullrange</span><span class="p">),</span>
<span class="n">step</span><span class="o">=</span><span class="n">dac_step</span><span class="p">,</span>
<span class="n">delay</span><span class="o">=</span><span class="n">dac_delay</span><span class="p">,</span>
<span class="n">max_delay</span><span class="o">=</span><span class="n">dac_max_delay</span><span class="p">,</span>
Expand All @@ -289,9 +294,6 @@ <h1>Source code for qcodes.instrument_drivers.QuTech.IVVI</h1><div class="highli
<span class="bp">self</span><span class="o">.</span><span class="n">_update_time</span> <span class="o">=</span> <span class="mi">5</span> <span class="c1"># seconds</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_time_last_update</span> <span class="o">=</span> <span class="mi">0</span> <span class="c1"># ensures first call will always update</span>

<span class="bp">self</span><span class="o">.</span><span class="n">pol_num</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_numdacs</span><span class="p">)</span> <span class="c1"># corresponds to POS polarity</span>
<span class="bp">self</span><span class="o">.</span><span class="n">set_pol_dacrack</span><span class="p">(</span><span class="s1">&#39;BIP&#39;</span><span class="p">,</span> <span class="nb">range</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_numdacs</span><span class="p">),</span> <span class="n">get_all</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>

<span class="n">t1</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>

<span class="c1"># make sure we ignore termination characters</span>
Expand Down Expand Up @@ -339,7 +341,7 @@ <h1>Source code for qcodes.instrument_drivers.QuTech.IVVI</h1><div class="highli

<div class="viewcode-block" id="IVVI.set_dacs_zero"><a class="viewcode-back" href="../../../../api/generated/qcodes.instrument_drivers.QuTech.html#qcodes.instrument_drivers.QuTech.IVVI.IVVI.set_dacs_zero">[docs]</a> <span class="k">def</span> <span class="nf">set_dacs_zero</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_numdacs</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_set_dac</span><span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s1">&#39;dac</span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">),</span><span class="mi">0</span><span class="p">)</span></div>

<span class="c1"># Conversion of data</span>
<span class="k">def</span> <span class="nf">_mvoltage_to_bytes</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mvoltage</span><span class="p">):</span>
Expand Down Expand Up @@ -453,7 +455,7 @@ <h1>Source code for qcodes.instrument_drivers.QuTech.IVVI</h1><div class="highli
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">ex</span><span class="p">:</span>
<span class="n">logging</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s1">&#39;IVVI communication error trying again&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">i</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">==</span> <span class="n">max_tries</span><span class="p">:</span> <span class="c1"># +1 because range goes stops before end</span>
<span class="k">raise</span><span class="p">(</span><span class="s1">&#39;IVVI Communication error&#39;</span><span class="p">)</span>
<span class="k">raise</span> <span class="n">ex</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mvoltages</span>

<div class="viewcode-block" id="IVVI.write"><a class="viewcode-back" href="../../../../api/generated/qcodes.instrument_drivers.QuTech.html#qcodes.instrument_drivers.QuTech.IVVI.IVVI.write">[docs]</a> <span class="k">def</span> <span class="nf">write</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">message</span><span class="p">,</span> <span class="n">raw</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
Expand Down
4 changes: 1 addition & 3 deletions api/generated/qcodes.instrument_drivers.QuTech.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,13 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
<span id="qcodes-instrument-drivers-qutech-ivvi-module"></span><h2>qcodes.instrument_drivers.QuTech.IVVI module<a class="headerlink" href="#module-qcodes.instrument_drivers.QuTech.IVVI" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="qcodes.instrument_drivers.QuTech.IVVI.IVVI">
<em class="property">class </em><code class="descclassname">qcodes.instrument_drivers.QuTech.IVVI.</code><code class="descname">IVVI</code><span class="sig-paren">(</span><em>name</em>, <em>address</em>, <em>reset=False</em>, <em>numdacs=16</em>, <em>dac_step=10</em>, <em>dac_delay=0.1</em>, <em>dac_max_delay=0.2</em>, <em>safe_version=True</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/qcodes/instrument_drivers/QuTech/IVVI.html#IVVI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#qcodes.instrument_drivers.QuTech.IVVI.IVVI" title="Permalink to this definition"></a></dt>
<em class="property">class </em><code class="descclassname">qcodes.instrument_drivers.QuTech.IVVI.</code><code class="descname">IVVI</code><span class="sig-paren">(</span><em>name, address, reset=False, numdacs=16, dac_step=10, dac_delay=0.1, dac_max_delay=0.2, safe_version=True, polarity=['BIP', 'BIP', 'BIP', 'BIP'], **kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/qcodes/instrument_drivers/QuTech/IVVI.html#IVVI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#qcodes.instrument_drivers.QuTech.IVVI.IVVI" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">qcodes.instrument.visa.VisaInstrument</span></code></p>
<dl class="docutils">
<dt>Status: Alpha version, tested for basic get-set commands</dt>
<dd><dl class="first last docutils">
<dt>TODO:</dt>
<dd><ul class="first last simple">
<li>Add individual parameters for channel polarities</li>
<li>Test polarities different from BIP</li>
<li>Add adjustable range and rate protection per channel</li>
<li>Add error handling for the specific error messages in the
protocol</li>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 7a83a5f

Please sign in to comment.