PIPLATElogger

PIPLATElogger is a free program which allows you to monitor and capture data from your Pi-Plate stack. Data can be logged to CSV files - a format compatible with all popular spreadsheet applications including Microsoft Excel, LibreOffice Calc, and Google Sheets to name a few. The software is written in Python and uses Tkinter and Pmw for the graphical user interface. There are two versions of the program: the original version that runs on the Raspberry Pi and a Windows version that communicates to the Pi-Plate boards through our MICROpi controller.  Note that this software is copyright 2023 under version 3 of the GNU General Public License. The terms of this license can be found in the Help menu or at this link: http://www.gnu.org/licenses/gpl-3.0-standalone.html

For Raspberry Pi

To use PIPLATElogger on the Raspberry Pi, you will need the following:

  1. A Raspberry Pi running the Raspberry Pi operating system. While this program should run on any version of the RPi, we recommend a version 3 as a minimum.
  2. At least one DAQCplate, DAQC2plate, THERMOplate, ADCplate, or CURRENTplate from Pi-Plates. If you don’t have one of these products yet, we invite you to visit our website at https://pi-plates.com and check them out.
  3. Be sure to follow these instructions on how to set up your Raspberry Pi so that it can talk to the Pi-Plate.
  4. An up to date installation of the Pi-Plate Python modules. Use “sudo pip install Pi-Plates” if you have a new setup or “sudo pip install –U Pi-Plates” to update.
  5. The PMW megawigdets. This module is included in the RPi OS but may not be up to date. PIPLATElogger will perform the update automatically.
  6. To fit as much information on the screen, this program runs at a fixed screen size of 1280 x 720. Therefore, it is recommended that you use a FHD monitor (1920X1080) for the best experience. If you are using VNCSERVER for remote access or headless operation, be sure to set the GEOMETRY option to 1280x720 or greater.
  7. Finally, you will need to download and install PIPLATElogger for the Raspberry Pi:
    1. Download the files from our server with:
      sudo wget https://pi-plates.com/downloads/PIPLATElogger.tar.gz
    2. Then decompress them into your home directory: sudo tar -xzvf PIPLATElogger.tar.gz
    3. Change to the Applications folder with: cd Applications
    4. Open a terminal window and launch the program with: python PIPLATElogger.py

For Windows

Using the PIPLATElogger with a Windows PC requires the following steps:

  1. A computer running Windows 10 or later
  2. An installation of Python3. If you don't already have this, we recommend installing Thonny which includes Python3 as well as a light weight editor.
  3. A MICROpi controller - this allows the PC to communicate to Pi-Plates
  4. A USB-A to microUSB cable - this cable is included with the MICROpi
  5. One or more of the following Pi-Plates: DAQCplate, DAQC2plate, THERMOplate, ADCplate, CURRENTplate, or the DIGIplate.
  6. The PIPLATElogger script and support files which can be downloaded from HERE.
  7. Once you have downloaded the script, unzip it to your hard drive. It should create a folder called PIPLATElogger.
  8. Right click that folder, and select "Open command prompt here".
  9. Before launching the logger, ensure you have the required Pmw module by typing pip install Pmw <ENTER> at the command prompt
  10. Once Pmw is installed, launch the logger by typing python PIPLATElogger.py <ENTER> at the command prompt

Documentation

Note that there may be some visual differences in the screens below due to the way Windows and Linux handle menu text

Main Screen Elements

The opening screen of PIPLATElogger is shown in Figure 1 below. There are five primary areas highlighted:

  1. Menubars: this is where you’ll open log files, make and save global setup values, start and stop data logging and view your data. All of these options are covered in excruciating detail below. Black menu words trigger drop-down menus while the colored menu items trigger actions.
  2. Tabs: PIPLATElogger will display a selection tab for each compatible Pi-Plate on the stack. To see the real time data from a particular Pi-Plate or to change the selected channels, just click its tab.
  3. Bulk Channel Controls: these two buttons provide a simple means of selecting or deselecting all of the input channels on the selected Pi-Plate.
  4. The Channel Select Box / Name / Current Value: these three fields are displayed for each input channel on the selected Pi-Plate.
    1. By checking a channel select box, you will be able to monitor its value in real time on the Input Window to the right as well as saving the values to a file when a logging session is executed.
    2. The channel name field can be changed to reflect a more descriptive name of your input signal. This name will be saved to the log file along with the data. To modify, just click anywhere in the text box to edit the default title.
    3. The value shows the current measurement of a channel if it is enabled.
  5. Input Windows: these are mini real time plots of each selected channel. There are approximately 600 points on each graph with the newest data appearing on the right and old data sliding off to the left. Different Pi-Plates display different data types depending on their capabilities.

Figure 1

Operation

There are three operational modes when using PIPLATElogger: Idle/Setup, Logging, and Viewing Logged Data.

Idle / Setup

This is the default mode for PIPLATElogger. It is here where you can select the channels you wish to monitor, change their names, create a logging file, test your setup, save and restore configurations

Logging Setup

There are three steps for creating a log:

  • Create or open a log file
  • Select the sample rate and sample count for your log
  • START the log
Saving to a File

To save your log to a local file, click on LOG SETUP->Open New File for Logging:

Figure 2

A new dialog box will pop up and prompt you to enter the name of your new log file. You can also over write an existing log file. Note that all log files are automatically assigned the extension “csv.” Once you have typed in or selected your file, click the Save button. If you chose to over write an existing file, the system will ask you to verify this action. When you are done with this step, the data from all selected channels will be written to this file while the program is in the Logging mode.

Figure 3

Sample Rate / Count

To change the sample period and count, click LOG SETUP -> Set Logging Parameters on the menu bar. A small menu will pop up and you will be to modify these two values. A couple of things to note:

  1. The minimum sample period is dictated by the number of Pi-Plates on your stack. A single DAQC, for example, will require 0.2 seconds to capture all eight analog inputs, capture all eight digital inputs, and to update the data in the PIPLATElogger window. Two Pi-Plates will force the minimum period to 0.4 seconds. Three will force it to 0.6 and so on. So, for maximum sample rates, keep your Pi-Plate count low.
  2. The Log Duration is the product of SampleCount X SamplePeriod. So, if you choose a Sample Period of 1 second and you set the Sample Count to 1000, then the logging duration shall be 1000 X 1 = 1000 seconds or 16 minutes and 40 seconds.

Figure 4

Note that the Period and Count values are part or the information saved when you choose File -> Save Configuration.

Channel Configuration

As mentioned previously, you can choose the channels on each Pi-Plate that you want to monitor simply by clicking the checkbox in front of its name as shown in Figure 1. You can also edit the channel names by clicking in the text field and changing the default entries to values that are more descriptive of their source. Your data from your selected channels and the custom names will be saved to the log file.

Saving and Restoring a Configuration

In the File dropdown menu there are commands for Saving and Restoring the Configuration. This is a pretty handy feature if you have a setup that you plan to use repeatedly. The configuration will include the selected channels, their names, the sample period, the sample count, and your optional streaming parameters.

Be advised that if you save a configuration and then modify your stack by adding or removing a Pi-Plate, PIPLATElogger will show an error message when you try to restore that old configuration.

Logging Data

The moment has finally arrived! You’ve created a log file and set up you sample time and count. Maybe you selected and renamed specific channels as well. It’s logging time. Just click the word START on the menu bar and PIPLATElogger will start saving data to your selected file. The status of the logger along with the remaining number of samples and time to completion will be displayed in the title bar of the program as shown in Figure 5. After the logging has completed, you will be alerted with the message shown in Figure 6

If for any reason you want to halt the logger then simply click on the word STOP in the menu bar.

A few things to note:

  • If you stop a log and then click START again, the data previously saved to your log file will be lost. To avoid this, choose a new log file before starting another session.
  • While logging, most menu items are disabled.

Figure 5

Figure 6

Viewing Logged Data

PIPLATElogger saves data to files in a format called CSV or Comma Separated Variables. This format makes it easy to open and edit with a simple text editor. CSV files can also be imported into many popular spreadsheet programs such as LibreOffice Calc.

The program provides two methods to view your log data. To access these, click VIEW on the menu bar. The following buttons will then pop up:

Figure 7

File

Clicking the View Data File and following the prompts allows you to view your raw log data using the text editor.

The first line of text is the channel names while the remaining lines are a time stamp followed by the channel data. Analog data is represented by numbers in a decimal format (3.82, 2.96, 1.00, etc.) while the digital input data is represented by ones and zeros.

While you can edit this file, be careful not to delete any of the commas separating the data. Otherwise, you won’t be able to open it with your spreadsheet program.

Figure 8

Spreadsheet

The final button, Open Data in Spreadsheet passes the selected log file to your spreadsheet application. In some cases you will be prompted to choose the delimiter that separates the data in your file as shown for LibreOffice Calc in Figure 9. Click the checkbox in front of “Comma” followed by the OK button. Your log file data will now be presented to you in tabular form.

Figure 9

By using a spreadsheet, not only is your data organized and viewable in a nice clean format but it’s also possible to plot it out using a number of different formats. In LibreOffice Calc, for example, while holding down the shift button, click on columns headers A, B, and C.  (Figure 10) Then click on the Plot Functions Icon. A preliminary plot will appear but we’re going to create a simple line graph. Choose that now and then stick with all of the default values. When finished, you should have a graph similar to Figure 11

Figure 10

Figure 11