Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW wiringPi Library for GPIO access

I have been using the dmBCM2835 library from DMurrayIRL for GPIO access to the Raspberry with LabVIEW in different projects for several years now, with complete satisfaction (thanks Murray).

For my next project, I am going to use a Raspberry Pi 5, and after a little research, I have found that this model is not supported by the bcm2835 library due to a change in the processor architecture.
Since using the standard library included in LINX/Hobbyst Toolkit is not an option due to the lack of certain features (such as PWM support), I have looked for other options.

Finally, I decided on the wiringPI library (https://github.com/WiringPi/WiringPi), which in its latest versions includes support for the Raspberry Pi 5. The native language of this library is C, although it has been wrapped for multiple languages, LabVIEW is not included list. Therefore, taking inspiration from the DMurrayIRL library, I created a wrapper on top of wiringPi for use with LabVIEW.

 

This message is to announce the initial version, which I have also made public on GitHub: https://github.com/juanjosevillacorta/WiringPi-LV

 

As an introduction, here is the content of the README file:


LabVIEW wrapper for WiringPi

A ligth wrapper that allow using wiringPi library (https://github.com/WiringPi/WiringPi) with LabVIEW-LINX.

Key Features:

  • Compatibility: Valid with all versions of Raspberry Pi compatible with LabVIEW-LINX: Pi2, Pi3, Zero 2w, Pi4, and Pi5..
  • GPIO: All pins can be configured as inputs or outputs, and an internal pull-up/pull-down resistor can be set. Edge detection functions are also available.
  • PWM: The two hardware PWM channels can be configured and used with the corresponding pins (PWM0 on GPIO12 and GPIO18, and PWM1 on GPIO13 and GPIO19). The remaining pins can be configured for software PWM.
  • SPI: Both channels, SPI0 and SPI1, can be used (if properly enabled in config.txt) and any of the corresponding chip select pins (CE0, CE1, or CE2) can be chosen.
  • I2C: Standard access to the I2C port with data and register read/write functions.
  • Timming: Funciones para implementar retardos en milisegundos y microsegundos

Whether you’re working on a simple LED blink project or a complex automation system, WiringPi provides the tools you need to get the job done efficiently.

Instalation

On your PC:

Use the JKI VIPM tool to open and install the witingPI-1.0.X.XXX.vipm library. The Funcitons menu will be updated to include the new blocks.

On your Raspberry:

libLVwiringPi.so (*) and libcrypt.so.1 libraries (available in <vi.lib>\wiringPi) must be copied to the Raspberry where the code will be executed in the /usr/lib folder of the LabVIEW chroot environment (/srv/chroot/labview/usr/lib on the main file system). This can be done manually, but a program for automatic installation is included: "Install Libraries.vi" in <vi.lib>\wiringPi. Run the program, enter the device details (Host, user, and password), and click Install.

(*) LibLVwiringPi.so is a version of wiringPi compiled within the LINX LabVIEW environment with some minor additions to support the LabVIEW's Call Library Funcition Node.


Attached to this message is the installation file with VIPM. There is no documentation, just a few examples, but I think the blocks are clear enough for anyone to use. If you have any questions about how they work, you can ask me.

 

Any comments are welcome.

0 Kudos
Message 1 of 1
(55 Views)