Skip to content

Commit

Permalink
Improved docs on low level and middle level
Browse files Browse the repository at this point in the history
Close #94
  • Loading branch information
hgrecco committed Aug 24, 2015
1 parent 1f6df2a commit 3f69464
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions docs/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,36 +63,43 @@ After you have instantiated the `ResourceManager`::

you can access the corresponding `VisaLibrary` instance under the `visalib` attribute.

As an example, consider the VISA function `viMapAddress`. It appears in the low-level
layer as the static method `viMapAddress` of `visalib` attributed and also appears
in the middle-level layer as `map_address`.

You can recognize low and middle-level functions by their names. Low-level functions
carry the same name as in the shared library, and they are prefixed by `vi`.
Middle-level functions have a friendlier, more pythonic but still recognizable name.


Middle-level
~~~~~~~~~~~~

The `VisaLibrary` object exposes the middle-level functions which are
one-to-one mapped from the foreign library as bound methods.

Typically, camelCase names where stripped from the leading `vi` and changed to underscore
separated lower case names. For example the VISA function `viMapAddress` appears
in the middle-level layer as `map_address`. The docs about these methods is located
here :ref:`api`.
separated lower case names. The docs about these methods is located here :ref:`api`.


Low-level
~~~~~~~~~

You can also access the low-level functions directly exposed as static methods,
You can access the low-level functions directly exposed as static methods,
for example::

>>> rm.visalib.viMapAddress(<here goes the arguments>)

To call this functions you need to know the function declaration and how to
interface it to python. To help you out, the `VisaLibrary` object also contains
middle-level functions. Each middle-level function wraps one low-level function.
middle-level functions.

It is very likely that you will need to access the VISA constants using these methods.
You can find the information about these constants here :ref:`api_constants`


Middle-level
~~~~~~~~~~~~

The `VisaLibrary` object exposes the middle-level functions which are
one-to-one mapped from the foreign library as bound methods.

Each middle-level function wraps one low-level function.
In this case::

>>> rm.visalib.map_address(<here goes the arguments>)

The calling convention and types are handled by the wrapper.

0 comments on commit 3f69464

Please sign in to comment.