Example Code

Reading .ABF Files in LabVIEW or SignalExpress

Code and Documents


These example VIs show how to read Axon Instruments .abf file in LabVIEW and SignalExpress. They support up to ABF Version 2.0.

The attached ZIP file (Read ABF.zip) includes the following VIs that you can use to read ABF files.

  • ABFImport_Open.vi
  • ABFImport_GetChannelNumber.vi
  • ABFImport_ReadChannel.vi
  • ABFImport_Close.vi

The ZIP file also includes two examples showing how to use these VIs. The Read ABF File VI shows how to read signals form an ABF file. The Extract RR Intervals VI shows how to read an ECG signal from an ABF file and how to extract R-R intervals from the ECG signal. The Extract RR Intervals VI uses the WA Multiscale Peak Detection VI in the Advanced Signal Processing Toolkit.

The following figure shows the block diagram of the Read ABF File VI:

Figure 1. Block Diagram of the Read ABF File VI

In LabVIEW SignalExpress, you can add a SignalExpress step to load signals in an ABF file into LabVIEW SignalExpress by using the Read ABF File VI. Complete the following steps to add the SignalExpress step:

  1. Choose File»New Project in LabVIEW SignalExpress to create a new project.
  2. Click the Add Step button and choose Run LabVIEW VI»Run LabVIEW 8.5 VI in the Add Step dialog box.

Figure 2. Add a SignalExpress Step to Run LabVIEW VIs

  1. In the Settings page of the configuration panel that appears, click the Browse button and navigate to the Read ABF File VI that you get from the attached ZIP file.

Figure 3. Specify the LabVIEW VI to Run

  1. In the Configure VI page, click the Browse button and navigate to the ABF file from which you want to read signals.

Figure 4. Specify the ABF File from Which to Read Signals

  1. Run the VI to extract the signals. You can drag the signals to the Data View graph.

Figure 5. Extracted Signals

  1. (Optional) You can add more SignalExpress steps to analyze the signals.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.