LabRAD for LabVIEW Tutorial
Overview
This tutorial will soon consist of several parts:
- First, we will guide you through installing the VIs.
- Second, you will be developing a LabRAD Server Module (coming soon)
- Third, you will be developing a LabRAD Client Module (coming soon)
Installing the VIs
After downloading the current API package - LabRAD-VIs-native-v0.9.2.zip - you have two choices for how you would like to access the VIs from your applications Block Diagram:
- To have the VIs available in the User Libraries section of the Functions Palette, you need to extract the downloaded zip file into the user.lib directory inside your LabVIEW installation folder. Then you might want to rename the extracted folder from LabRAD-VIs-native-v0.9.2 to simply LabRAD.
- To use Select a VI... to place the components, you can unzip the downloaded file into any directory of your choice. All you need to do is remember where you placed them.
Depending on your choice, you can now either use the bottom right-hand icon in your Functions Palette like in the following screen shot, or you have to use the bottom left-hand icon and browse for the icons manually:
With either method, you should now be able to access the following VIs (excluding the contents of the "internal" folder, which you will probably not need to use directly):
|
Icon |
|
Filename |
|
Description |
|
|
|
|
Build Packet.vi |
|
Assembles records into a Request packet |
|
|
|
|
Parse Packet.vi |
|
Extracts records from Reply packet |
|
|
|
|
Simple Client Connection.vi |
|
Establishes a simple Client Connection to the LabRAD Manager |
|
|
|
|
Simple Disconnect.vi |
|
Disconnects a simple Connection |
|
|
|
|
Simple Request.vi |
|
Sends a Request Packet and waits for a Reply |
|
|
|
|
Look Up Manager Info.vi |
|
Tries to read the connection details from the Windows environment variables |
|
Now, what's with all the "Simple"?
There will be three versions of the LabVIEW API that you can choose from:
- Simple Connections are a very tight wrapper around the native LabVIEW TCP Connection components. They expect predictably serialized traffic on the network connection. This probably gives the VIs slightly better native performance, but does not allow for Messages or concurrent Requests, since those would require interleaved data with unpredictable serialization. For the same reason, Server Modules using Simple Connections cannot make any LabRAD Requests at all on the connection they use to listen for Requests. But for building - well - "simple" user interfaces to an experiment, these should definitely provide sufficient functionality.
- Receive Loop Connections utilize LabVIEW Notifiers and Events to route Requests, Replies, and Messages between your application and a centralized loop that handles all network traffic. This gives access to all features of LabRAD, including Messages and having multiple Requests in flight simultaneously. But, these connections might not perform as well as Simple Connections due to the added overhead.
- Delphi DLL Connections use a library written in Delphi to handle all network traffic and to assemble packets and route them into the appropriate queues. These components will most likely yield the best performance, but will only be available for Windows and are currently somewhat far from completion.
... to be continued ...
For now, you can complete the LabRAD Tutorial, which contains a part that introduces the LabVIEW VIs.
~ Markus Ansmann, Feb 26th, 2008