..
 #############################################################
 # This file was automatically generated on 2015-05-08.      #
 #                                                           #
 # If you have a bugfix for this file and want to commit it, #
 # please fix the bug in the generator. You can find a link  #
 # to the generators git repository on tinkerforge.com       #
 #############################################################

:orphan:
:breadcrumbs: <a href="../../index.html">Home</a> / <a href="../../index.html#software-shell">Software</a> / Shell - Industrial Analog Out Bricklet

.. |device_identifier_constant| unicode:: 0xA0
   :trim:

.. _industrial_analog_out_bricklet_shell:

Shell - Industrial Analog Out Bricklet
======================================

.. note::
 This Bricklet is currently in the prototype stage and the software/hardware
 as well as the documentation is in an incomplete state.


This is the description of the :ref:`Shell API bindings <api_bindings_shell>` for the :ref:`Industrial Analog Out Bricklet <industrial_analog_out_bricklet>`. General information and technical
specifications for the Industrial Analog Out Bricklet are summarized in its :ref:`hardware description
<industrial_analog_out_bricklet_description>`.

An :ref:`installation guide <api_bindings_shell_install>` for the Shell API
bindings is part of their general description.

.. _industrial_analog_out_bricklet_shell_examples:


Examples
--------

The example code below is `Public Domain (CC0 1.0)
<http://creativecommons.org/publicdomain/zero/1.0/>`__.

Simple Current
^^^^^^^^^^^^^^

`Download (example-simple-current.sh) <https://github.com/Tinkerforge/industrial-analog-out-bricklet/raw/master/software/examples/shell/example-simple-current.sh>`__

.. literalinclude:: IndustrialAnalogOut_Bricklet_Shell_example-simple-current.sh
 :language: bash
 :linenos:
 :tab-width: 4

Simple Voltage
^^^^^^^^^^^^^^

`Download (example-simple-voltage.sh) <https://github.com/Tinkerforge/industrial-analog-out-bricklet/raw/master/software/examples/shell/example-simple-voltage.sh>`__

.. literalinclude:: IndustrialAnalogOut_Bricklet_Shell_example-simple-voltage.sh
 :language: bash
 :linenos:
 :tab-width: 4

.. _industrial_analog_out_bricklet_shell_api:

API
---

Possible exit codes for all ``tinkerforge`` commands are:

* 1: interrupted (ctrl+c)
* 2: syntax error
* 21: Python 2.5 or newer is required
* 22: Python ``argparse`` module is missing
* 23: socket error
* 24: other exception
* 25: invalid placeholder in format string
* 26: authentication error
* 201: timeout occurred
* 209: invalid argument value
* 210: function is not supported
* 211: unknown error



Command Structure
^^^^^^^^^^^^^^^^^

The common options of the ``call`` and ``dispatch`` commands are documented
:ref:`here <ipcon_shell_api>`. The specific command structure is shown below.

.. sh:function:: X Stinkerforge Pcall Nindustrial-analog-out-bricklet A[<option>..] L<uid> L<function> L[<argument>..]

 :param <uid>: string
 :param <function>: string

 The ``call`` command is used to call a function of the Industrial Analog Out Bricklet. It can take several
 options:

 * ``--help`` shows help for the specific ``call`` command and exits
 * ``--list-functions`` shows a list of known functions of the Industrial Analog Out Bricklet and exits


.. sh:function:: X Stinkerforge Pdispatch Nindustrial-analog-out-bricklet A[<option>..] L<uid> L<callback>

 :param <uid>: string
 :param <callback>: string

 The ``dispatch`` command is used to dispatch a callback of the Industrial Analog Out Bricklet. It can
 take several options:

 * ``--help`` shows help for the specific ``dispatch`` command and exits
 * ``--list-callbacks`` shows a list of known callbacks of the Industrial Analog Out Bricklet and exits


.. sh:function:: X Stinkerforge Scall Pindustrial-analog-out-bricklet L<uid> N<function> A[<option>..] L[<argument>..]

 :param <uid>: string
 :param <function>: string

 The ``<function>`` to be called can take different options depending of its
 kind. All functions can take the following options:

 * ``--help`` shows help for the specific function and exits

 Getter functions can take the following options:

 * ``--execute <command>`` shell command line to execute for each incoming
   response (see section about :ref:`output formatting <ipcon_shell_output>`
   for details)

 Setter functions can take the following options:

 * ``--expect-response`` requests response and waits for it

 The ``--expect-response`` option for setter functions allows to detect
 timeouts and other error conditions calls of setters as well. The device will
 then send a response for this purpose. If this option is not given for a
 setter function then no response is send and errors are silently ignored,
 because they cannot be detected.


.. sh:function:: X Stinkerforge Sdispatch Pindustrial-analog-out-bricklet L<uid> N<callback> A[<option>..]

 :param <uid>: string
 :param <callback>: string

 The ``<callback>`` to be dispatched can take several options:

 * ``--help`` shows help for the specific callback and exits
 * ``--execute <command>`` shell command line to execute for each incoming
   response (see section about :ref:`output formatting <ipcon_shell_output>`
   for details)



Basic Functions
^^^^^^^^^^^^^^^



.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> enable  


 :noreturn: no output

 Enables the output of voltage and current.
 
 The default is disabled.
 
.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> disable  


 :noreturn: no output

 Disables the output of voltage and current.
 
 The default is disabled.
 
.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> is-enabled  


 :returns enabled: bool

 Returns *true* if output of voltage and current is enabled, *false* otherwise.
 
.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> set-voltage <voltage> 

 :param <voltage>: int

 :noreturn: no output

 Sets the output voltage in mV.
 
.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> get-voltage  


 :returns voltage: int

 Returns the voltage as set by :sh:func:`set-voltage <industrial-analog-out-bricklet set-voltage>`.
 
.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> set-current <current> 

 :param <current>: int

 :noreturn: no output

 Sets the output current in µA.
 
.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> get-current  


 :returns current: int

 Returns the current as set by :sh:func:`set-current <industrial-analog-out-bricklet set-current>`.
 


Advanced Functions
^^^^^^^^^^^^^^^^^^

.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> set-configuration <voltage-range> <current-range> 

 :param <voltage-range>: int (has symbols)
 :param <current-range>: int (has symbols)

 :noreturn: no output

 Configures the voltage and current range.
 
 Possible voltage ranges are:
 
 * 0V to 5V
 * 0V to 10V
 
 Possible current ranges are:
 
 * 4mA to 20mA
 * 0mA to 20mA
 * 0mA to 24mA
 
 The resolution will always be 12 bit. This means, that the
 precision is higher with a smaller range.
 
 The following symbols are available for this function:
 
 * ``0-to-5v`` = 0, for <voltage-range>
 * ``0-to-10v`` = 1, for <voltage-range>
 * ``4-to-20ma`` = 0, for <current-range>
 * ``0-to-20ma`` = 1, for <current-range>
 * ``0-to-24ma`` = 2, for <current-range>
 
.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> get-configuration  


 :returns voltage-range: int (has symbols)
 :returns current-range: int (has symbols)

 Returns the configuration as set by :sh:func:`set-configuration <industrial-analog-out-bricklet set-configuration>`.
 
 The following symbols are available for this function:
 
 * ``0-to-5v`` = 0, for voltage-range
 * ``0-to-10v`` = 1, for voltage-range
 * ``4-to-20ma`` = 0, for current-range
 * ``0-to-20ma`` = 1, for current-range
 * ``0-to-24ma`` = 2, for current-range
 
.. sh:function:: tinkerforge call industrial-analog-out-bricklet <uid> get-identity  


 :returns uid: string
 :returns connected-uid: string
 :returns position: char
 :returns hardware-version: int,int,int
 :returns firmware-version: int,int,int
 :returns device-identifier: int (has symbols)

 Returns the UID, the UID where the Bricklet is connected to, 
 the position, the hardware and firmware version as well as the
 device identifier.
 
 The position can be 'a', 'b', 'c' or 'd'.
 
 The device identifier numbers can be found :ref:`here <device_identifier>`.
 |device_identifier_constant|
 


