Getting started with our third party Linux drivers and a Raspberry Pi

The Raspberry Pi has become a popular single-board computing platform for implementing data acquisition on Linux.  To use a Measurement Computing device with the Raspberry Pi, you first need a Linux driver for the device.  You can find open source Linux drivers for most Measurement Computing devices on github:

In addition to device drivers, you will need an IDE and tools to create the user interface for your application.

Since finding, downloading, compiling, making, and installing these tools can be time consuming for newbies and experienced programmer alike, a downloadable image was created containing everything you need to run sample applications for an MCC Device on a Raspberry Pi. Note that this image was built to support the USB-1608G series devices and a RaspberryPi3.  You can easily modify the environment and code to use other MCC devices as desired.

The image contains the follow:
Raspbian GNU/Linux 9,
USB-1608G Linux driver included in,
Code Blocks for the IDE,
Glade graphical interface builder, GTK+ 3.0 widget toolkit, and GTKDatabox widget,
GUI-based sample applications to exercise all the major features of the USB-1608G, ‘GX, and ‘GX-2AO devices including the following:
o Analog Input:
Software paced
Hardware paced
2 boards, software based
o Analog Output:
Single point
Hardware paced (function generator)
o Digital input/output
o Counter In
o Timer out

Getting the image onto your Raspberry Pi 3

To get the image on to your Raspberry Pi, perform the following steps on a Windows OS PC:

1. Download and install a copy of Win32DiskImager or similar software.
2. Get an SD card with a USB adapter if you do not already have one.  An 8GB microSDHC UHS-I card, is required and is readily available for less than $10.00.
3. Download the zip file from the link provided at the end of this KB article.
4. Unzip it,  by right clicking on the zip file and select Extract All.., and follow the on screen prompts.
5. Launch the Win32DiskImager software, which steps you through uploading the image to the SD card for use with your Raspberry Pi.
6. Insert the SD card into your Raspberry Pi’s operating system card slot and apply power to the Raspberry Pi.

When the system boots, you will have a Raspbian installation that has Code Blocks, Glade, GTK+ 3.0, GTKDatabox, Community supported MCC Linux drivers, and examples all installed and ready to use.

Exercising the Hardware
To use the USB-1608G series device with a Raspberry Pi, perform the follow steps:

Connect a USB cable from the USB port on the Pi to the USB port on the USB-1608G series device.
From the Pi’s GUI interface, click on the Raspberry Icon at bottom left, select Programming >> Code::Blocks IDE.  
o When the IDE opens, click File >> Open..  An open file dialog box appears. 
o Select the Documents folder >> Code Blocks>> USB1608G>> and select the folder of an example.  For the purpose of this KB article, we will start with USB1608G_A.  
o Select T_USB1608G.cbp and click Open.
o If the code is not already displayed, from the left side, select main.c under Sources.
o Build it by clicking on Build >> Build or Ctrl + F9.
o Run it by clicking Build  >> Run or Ctrl + F10
Depending upon the example, connect an appropriate signal source, meter or oscilloscope. 

The USB1608G_A example will perform most of the devices functions in the one app.
Build and run the other examples as desired.

Taking it from here

Feel free to modify these examples or create your own Linux-based application to access the functionality of MCC devices and the raspberry Pi.

Link to the image file:

Posted 2/21/2018 9:49:25 AM by Jeff