Got your hands on the LabVIEW 2020 Community Edition Beta and eager to get started? There are a few simple steps that existing LabVIEW programmers need to be familiar with to setup a BeagleBone Black (BBB) or Raspberry Pi for use with LabVIEW Community Edition.
Note that these instructions do not apply to the Arduino, as it is tethered to the development computer instead of targeted for stand-alone deployment
Step 1: Connect the Targets
You will be connecting to these targets using their IP address via SSH. This is still true if you connect the target directly to your computer, as it creates a ethernet connection over USB.
Both targets run a version of the Debian OS, but there is one important difference:
- The BeagleBone is configured out of the box with SSH enabled and a default username and password. Consequently, you should be able to connect immediately
- The latest versions of the Debian OS on the Raspberry Pi disables SSH as a security precaution. Please consult the getting started content for the Raspberry Pi to re-enable SSH before proceeding.
You will need the username and password of your target, so please note these if you changed them from the defaults. Once you have the IP address of your target and SSH is enabled and working, proceed to Step 2
Step 2: Configure the Targets for Use with LabVIEW
Note: before proceeding be sure that your target has a direct internet connection. It is not sufficient to be connected via USB to your development machine, as it will need to download the run-time via its’ own network adapter. If, for example, the BBB is connected via USB to your computer, ensure it has an ethernet cable plugged in.
- Launch LabVIEW 2020
- Create a New Project
- Open the Target Configuration Wizard from Tools >> MakerHub >> LINX >> LINX Target Configuration Wizard
- Select the type of target from the drop-down
- Enter the IP address, username and password of your target and click ‘Connect’
- On the Installation Tab, install the run-time dependencies. Note that these will be downloaded from an online repository, so ensure you have an internet connection.
Note: The package that gets installed includes the LV runtime, the .so files that allow LV to perform I/O, and the chroot configuration that lets LV run on a hard-float target. Craig and Ken know the details, but this includes a refasonable number of directory links to let your LV program access the linux file system and services. The files are mostly located in the /srv/chroot/labview.
Once the installation of the run-times is completed, your target should be ready for use. You can click the button to Open the Examples or return to your empty project.
Repeat Step 2 to upgrade the run-times, as the latest version will always be installed on the target.
Step 3: Create Your Project
Perhaps the easiest way to do this is to open the shipping example that is linked to from the Target Configuration Page. If you prefer to start from scratch, do the following:
- Right click on the project item and select New >> Targets and Devices
- Add your target (two options)
- Option 1: Expand the LINX category to auto-discover your device on a local network
- Option 2: Manually select your device type by selecting the ‘New Target or Device Option.’ If you’ve manually added the target, you will need to specify the IP address by right clicking on the target in the project and selecting ‘Properties’
- Connect to your target. Right click on the project item and select ‘Connect’
- Save your project
Your target is now connected and ready for programming
Step 4: Development and Debugging
This will feel very familiar to any experienced LabVIEW programmer. Create your top-level VI and develop the code that you wish to run on the target. To interact with the device and any peripherals, you will use the API that is installed in this location:
The API uses a standard configure >> read/write >> close method that should feel familiar to DAQ programmers. You will need to consult the pin map of your device, which is linked to from within LabVIEW, here:
Help >> MakerHub >> LINX >> Pinout
You can execute your code at any time on the target by clicking the run button of your VI. This will download any changes to the target and begin execution. Normal probes and breakpoints can be used to interactively control execution and debug your application.
You can also manipulate and control the front panel from within the development environment when interactively debugging and developing, though this will not be possible once deployed for stand-alone execution
Step 5: Deployment as a Startup Executable for Stand-Alone Execution
Once your code is working and you are ready to deploying it to the target as a stand-alone executable, you will need to create a run-time executable in the Build Specifications.
Again, this will feel familiar to any experienced LabVIEW programmer and extensive tutorials are available online, but here’s the simple set of steps:
- Right-click on Build Specifications to create a New > Real-Time Applicaiton
- Select your top-level VI as the Startup VI in the Source Files page
- Select Build
- Once completed, right click the real-time application under ‘Build Specifications’ for a host of options. You can then deploy your application and then set as a startup.
Summary and Links
Hopefully these instructions will help you get off and going. They cover the critical path, but there is obviously much more, so please comment or @ me on Twitter (@elijah286) if you have additional questions.
I also recommend the following resources:
- Sam Sharp’s step-by-step blog about the construction of a robot with LINX and a Raspberry Pi (still in work)
- labviewmakerhub.com getting started content (note that much of this content references the 2014 edition and needs updating)