Creating a library for Novint’s Falcon haptic programming with LabVIEW

Novint, the device manufacturer provides both a driver (It is just a UART over USB device) and a C++ SDK. You need to install them. I don’t want to use C++ and learn how to use a set of classes hierarchy. I just want to read potitions and send forces!

If you Google for a LabVIEW library for this device you may find Mauro’s page with a password protected ZIP file with the library. Unfortunately its e-mail is not alive.

Another programming option is to use the Siena’s Haptik library. This is a vendor-independent hardware library, which is nice because you don’t need to learn how to use different haptic API’s but you still need to learn to use C++ classes which is not compatible with LabVIEW. However some examples of use of this library from matlab and simulink are a plus.

I felt a bit frustrated because I didn’t wanted to spend a lot of time developing my teaching tools, but surprisingly it has been surprisingly easy to create a Falcon library with LabVIEW. You just need to tell LabVIEW the locations of the main SDK’s .dll and .h file and the library creation tool builds the library for you. No C++ classes programming knowledge is needed. Just initialize and read/write positions/forces inside a loop.

What follows is a step-by-step guide on how to program a Nivont’s Falcon haptic device under LabVIEW development system. In this example I used version 2009 and 2011. Hopefully it works in the same way in the latest versions.

Step 1: Start the Library Creation Tool

Menu shared Library

Step 2: Create the libraryMenu create Library

 

Just press “Next”.

Step 3: Specify the library locationMenu Library location

 

Step 4: Specify the includes: WARNING! Here you need to include bot the folder for the include files but also the preprocessor definition “WIN32” as shown in the figure.

Menu Library includes

 

Step 5: 23 out of 25 functions are automatically recognized. I don’t care about this. Enough for me. Click “Next”.Menu Functions

Step 6: It’s time for naming the library. I just left the original name and clicked “Next”.Menu Configure project library

Step 7: Select error handling. I choose the default option here too.

Menu No error handling

Step 8: Last chance for customizing functions VI’s. Execution model and input/output parameters. Happily you can use the default values here too.

Menu Configure VI

Step 9: Congratulations. This is the generation summary

Menu Summary

 

Step 10: You are done.

Menu Finish

Step 11: The library is yours now, and ready to be used.

hdl_lvlib

 

Also remember that you can always find it right-clicking on your VI diagram and then selecting User Libraries …Menu Find Library

That’s all.

Here you can find the hdl library (hdl Library). Make sure you have installed the latest Falcon drivers and SDK and then copy the folder “hdl” into your LabVIEW’s user.lib folder (2009 version).

Check also my other post about start programming the haptic.

Cheers.

Leave a Reply

Your email address will not be published. Required fields are marked *