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. The easiest option is to put the Tinkerforge.dll in the LabVIEW installation folder. For example, the default installation folder for LabVIEW 2015 is:

C:\Program Files\National Instruments\LabVIEW 2015\

The Tinkerforge.dll can also be put in the same folder as the .vi file that is going to use it. In both cases LabVIEW should automatically find the Tinkerforge.dll.

The ZIP file for the bindings contains two different versions of the Tinkerforge.dll:

  • For LabVIEW 2011 and older LabVIEW versions the Tinkerforge.dll from the net20 folder should be used.

  • For LabVIEW 2012 and newer LabVIEW versions the Tinkerforge.dll from the net40 folder should be used.

Warnings

LabVIEW might warn that the Tinkerforge.dll was loaded from a different folder. This warning can be ignored.

LabVIEW might also warn that it found a Tinkerforge.dll with a different version. If the found version is newer than the one LabVIEW was locking for, then you can ignore this warning. Otherwise you should update the LabVIEW bindings.

Errors

If LabVIEW reports error code 1386 "The specified .NET class is not available in LabVIEW." then make sure that all ".NET Constructor" nodes in the .vi file are configured correctly. Double click on a ".NET Constructor" node and select "Tinkerforge" as the "Assembly".

If the "Select .NET Assembly" dialog says "An error occurred trying to load the assembly", then check in Windows Explorer if the Tinkerforge.dll is marked as coming from another computer. If this is the case LabVIEW will refuse to load it.

Open the properties dialog of the Tinkerforge.dll in Windows Explorer. If there is an "Unblock" button at the bottom of the "General" page, then the file is blocked. Click the "Unblock" button and restart LabVIEW. The problem should be fixed now.

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 Tinkerforge.dll to the installation 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.

Front Panel Barometer Bricklet Graph Example

And here the corresponding block diagram:

Block Diagram Barometer Bricklet Graph Example

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 Kits section.

Name, API, Examples

Miscellaneous

IP Connection

API

Examples

Bricks

ESP32

API

ESP32 Ethernet

API

HAT

API

HAT Zero

API

IMU 2.0

API

Examples

Master

API

Examples

RED

API

Examples

Silent Stepper

API

Examples

Bricks (Discontinued)

DC

API

Examples

IMU

API

Examples

Servo

API

Examples

Stepper

API

Examples

Bricklets

Accelerometer 2.0

API

Air Quality

API

Examples

Ambient Light 3.0

API

Examples

Analog In 3.0

API

Examples

Analog Out 3.0

API

Examples

Barometer

API

Examples

Barometer 2.0

API

Examples

CAN

API

Examples

CAN 2.0

API

Examples

CO2 2.0

API

Color

API

Examples

Color 2.0

API

Compass

API

DC 2.0

API

Distance IR

API

Examples

Distance IR 2.0

API

Examples

Distance US 2.0

API

DMX

API

Dual Button 2.0

API

Examples

Dust Detector

API

Examples

E-Paper 296x128

API

Energy Monitor

API

GPS 2.0

API

Examples

GPS 3.0

API

Examples

Hall Effect

API

Examples

Hall Effect 2.0

API

Humidity 2.0

API

Examples

IMU 3.0

API

Examples

Industrial Analog Out 2.0

API

Examples

Industrial Counter

API

Examples

Industrial Digital In 4 2.0

API

Examples

Industrial Digital Out 4

API

Examples

Industrial Digital Out 4 2.0

API

Examples

Industrial Dual 0-20mA

API

Examples

Industrial Dual 0-20mA 2.0

API

Examples

Industrial Dual AC In

API

Industrial Dual AC Relay

API

Examples

Industrial Dual Analog In 2.0

API

Examples

Industrial Dual Relay

API

Examples

Industrial PTC

API

Industrial Quad Relay 2.0

API

Examples

IO-16

API

Examples

IO-16 2.0

API

IO-4 2.0

API

Examples

Isolator

API

Examples

Joystick

API

Examples

Joystick 2.0

API

Laser Range Finder 2.0

API

LCD 128x64

API

LCD 20x4

API

Examples

LED Strip 2.0

API

Line

API

Examples

Linear Poti

API

Examples

Linear Poti 2.0

API

Examples

Load Cell 2.0

API

Examples

Motion Detector 2.0

API

Examples

Motorized Linear Poti

API

Multi Touch

API

Examples

Multi Touch 2.0

API

NFC

API

OLED 128x64 2.0

API

Examples

OLED 64x48

API

Examples

One Wire

API

Outdoor Weather

API

Examples

Particulate Matter

API

Examples

Performance DC

API

Piezo Speaker

API

Examples

Piezo Speaker 2.0

API

Examples

Real-Time Clock

API

Examples

Real-Time Clock 2.0

API

Examples

Remote Switch 2.0

API

Examples

RGB LED 2.0

API

RGB LED Button

API

Rotary Encoder 2.0

API

Examples

Rotary Poti

API

Examples

Rotary Poti 2.0

API

Examples

RS232

API

Examples

RS232 2.0

API

Examples

RS485

API

Examples

Segment Display 4x7

API

Examples

Segment Display 4x7 2.0

API

Servo 2.0

API

Silent Stepper 2.0

API

Solid State Relay 2.0

API

Examples

Sound Intensity

API

Examples

Sound Pressure Level

API

Examples

Temperature

API

Examples

Temperature 2.0

API

Examples

Temperature IR 2.0

API

Examples

Thermal Imaging

API

Thermocouple 2.0

API

Examples

Tilt

API

Examples

UV Light 2.0

API

Examples

Voltage/Current 2.0

API

Examples

XMC1400 Breakout

API

Bricklets (Discontinued)

Accelerometer

API

Examples

Ambient Light

API

Examples

Ambient Light 2.0

API

Examples

Analog In

API

Examples

Analog In 2.0

API

Examples

Analog Out

API

Examples

Analog Out 2.0

API

Examples

CO2

API

Examples

Current12

API

Examples

Current25

API

Examples

Distance US

API

Examples

Dual Button

API

Examples

Dual Relay

API

Examples

GPS

API

Examples

Humidity

API

Examples

Industrial Analog Out

API

Examples

Industrial Digital In 4

API

Examples

Industrial Dual Analog In

API

Examples

Industrial Quad Relay

API

Examples

IO-4

API

Examples

Laser Range Finder

API

Examples

LCD 16x2

API

Examples

LED Strip

API

Examples

Load Cell

API

Examples

Moisture

API

Examples

Motion Detector

API

Examples

NFC/RFID

API

Examples

OLED 128x64

API

Examples

Piezo Buzzer

API

Examples

PTC

API

Examples

PTC 2.0

API

Examples

Remote Switch

API

Examples

RGB LED

API

Examples

RGB LED Matrix

API

Rotary Encoder

API

Examples

Solid State Relay

API

Examples

Temperature IR

API

Examples

Thermocouple

API

Examples

UV Light

API

Examples

Voltage

API

Examples

Voltage/Current

API

Examples