LabVIEW - API Bindings – Tinkerforge

- Getting Started
  - Primer
  - Tutorials
  - FAQ
- Hardware
  - Bricks
  - Bricklets
  - Master Extensions
  - Power Supplies
  - Accessories
  - Timeline
- Software
  - Brick Daemon (brickd)
  - Brick Viewer (brickv)
  - API Bindings
    - C/C++
    - C/C++ (iOS)
    - C#
    - C# (Windows Phone)
    - Delphi/Lazarus
    - Java
    - Java (Android)
    - JavaScript
    - LabVIEW
      - Requirements
      - Installation
      - Testing an Example
        - Stepper Brick
        - Barometer Bricklet
      - API Reference and Examples
        - IP Connection
        - Bricks
        - Bricklets
    - Mathematica
    - MATLAB/Octave
    - Perl
    - PHP
    - Python
    - Ruby
    - Shell
    - Visual Basic .NET
  - Firmwares and Plugins
  - Device Identifier
  - Source Code and Bug Tracking
  - Programming Interface
- Starter Kits
  - Weather Station
  - Hardware Hacking
  - Server Room Monitoring
  - Blinkenlights
  - Internet of Things
  - Camera Slider
- Embedded Boards
  - Raspberry Pi
- Specifications
  - Technical Data
  - TCP/IP Protocol
  - Modbus Protocol
  - Wireshark Dissector

# LabVIEW - API Bindings

The LabVIEW bindings allow you to control Bricks and Bricklets from your LabVIEW programs. The ZIP file for the bindings contains:

- `net20/Tinkerforge.dll`, a precompiled .NET 2.0 library
- `net40/Tinkerforge.dll`, a precompiled .NET 4.0 library
- in `source/` the source code of `Tinkerforge.dll`
- in `examples/` the examples for every Brick and Bricklet in LabVIEW 2010 and LabVIEW 2013 format

The LabVIEW bindings are based on the C# bindings. Since version 2.0.0 the C# bindings are CLS compliant. This allows to use them with all .NET compatible languages, such as LabVIEW's .NET support.

## Requirements

- LabVIEW on Windows with .NET support

## Installation

To make the bindings work LabVIEW has to be able to find the `Tinkerforge.dll`. Depending on your LabVIEW and Windows version you either need to use the `Tinkerforge.dll` from the `net20` or the `net40` folder. Try the NET 2.0 version first. If LabVIEW reports error code 1386 "The specified .NET class is not available in LabVIEW." then you need to use the NET 4.0 version instead.

If you open an example then LabVIEW will search for the `Tinkerforge.dll` and ask you if it could not find it. You can avoid this search and ask procedure by putting the `Tinkerforge.dll` in a folder known to LabVIEW. The easiest option is the `vi.lib` folder of your LabVIEW installation:

    C:\Program Files\National Instruments\LabVIEW 2013\vi.lib\

Then LabVIEW will find the `Tinkerforge.dll` automatically and does not ask for your support. But LabVIEW might warn that `Tinkerforge.dll` was loaded from a different folder. This warning can be ignored.

## Testing an Example

To test a LabVIEW example Brick Daemon and Brick Viewer have to be installed first. Brick Daemon acts as a proxy between the USB interface of the Bricks and the API bindings. Brick Viewer connects to Brick Daemon and helps to figure out basic information about the connected Bricks and Bricklets.

### Stepper Brick

As an example let's run the configuration example for the Stepper Brick. For this we copy the `Example Configuration.vi` file from the `examples/Brick/Stepper/` folder into a new folder:

    example_project/
     -> Example Configuration.vi

If you did not copy the bindings to the `vi.lib` folder of your LabVIEW installation then the `Tinkerforge.dll` file has to be copied to the `example_project/` folder as well before the example can be opened in LabVIEW:

    example_project/
     -> Tinkerforge.dll
     -> Example Configuration.vi

In the example `host` and `port` specify at which network address the Stepper Brick can be found. If it is connected locally to USB then `localhost` and 4223 is correct. The `uid` value has to be changed to the UID of the connected Stepper Brick, which you can figure out using Brick Viewer.

Now you're ready to test this example.

### Barometer Bricklet

Here's an another example showing a graph of air pressure values measured by a Barometer Bricklet.

And here the corresponding block diagram:

## API Reference and Examples

Links to the API reference for the IP Connection, Bricks and Bricklets as well as the examples from the ZIP file of the bindings are listed in the following table. Further project descriptions can be found in the Starter Kits section.

| API | Examples
--- | --- | ---
IP Connection | API | Examples
Bricks |  |
DC | API | Examples
IMU | API | Examples
Master | API | Examples
RED | API | Examples
Servo | API | Examples
Stepper | API | Examples
Bricklets |  |
Ambient Light | API | Examples
Analog In | API | Examples
Analog Out | API | Examples
Barometer | API | Examples
Color | API | Examples
Current12 | API | Examples
Current25 | API | Examples
Distance IR | API | Examples
Distance US | API | Examples
Dual Button | API | Examples
Dual Relay | API | Examples
GPS | API | Examples
Hall Effect | API | Examples
Humidity | API | Examples
Industrial Digital In 4 | API | Examples
Industrial Digital Out 4 | API | Examples
Industrial Dual 0-20mA | API | Examples
Industrial Quad Relay | API | Examples
IO-16 | API | Examples
IO-4 | API | Examples
Joystick | API | Examples
LCD 16x2 | API | Examples
LCD 20x4 | API | Examples
LED Strip | API | Examples
Line | API | Examples
Linear Poti | API | Examples
Moisture | API | Examples
Motion Detector | API | Examples
Multi Touch | API | Examples
NFC/RFID | API | Examples
Piezo Buzzer | API | Examples
Piezo Speaker | API | Examples
PTC | API | Examples
Remote Switch | API | Examples
Rotary Encoder | API | Examples
Rotary Poti | API | Examples
Segment Display 4x7 | API | Examples
Solid State Relay | API | Examples
Sound Intensity | API | Examples
Temperature | API | Examples
Temperature IR | API | Examples
Tilt | API | Examples
Voltage | API | Examples
Voltage/Current | API | Examples

The content of this page is licensed under Creative Commons Attribution 3.0 Unported License.