File Exchange > Data Connector >    PLEXON Connector

Author:
OriginLab Technical Support
Date Added:
2/26/2019
Last Update:
6/5/2023
Downloads (90 Days):
40
Total Ratings:
0
File Size:
254 KB
Average Rating:
File Name:
PLEXON Connector.opx
File Version:
1.20
Minimum Versions:
License:
Free
Type:
App
Summary:

Connect to a PLEXON file in PL2 format.

Screen Shot and Video:
Description:

This App connects the Origin project to a PLEXON file in PL2 format.

Installation

This App is not pre-installed with Origin. To install, click Data: Connect to File: Add New.... The App Center opens listing only Connector Apps. Click the Download and Install button beside PLEXON Connector to install the App.

Note: If your Origin version is 2023b or higher, you need download vcredist_x64-2005.exe and install it first.

Features
  • Variable Selection
    You can select some variables in the file to import and later alter your previous choices.
  • Web Data
    Besides connecting to a local file, you can connect your project to data from website.
Basic Usage
  1. With a worksheet active, click on the Data menu.
  2. To connect to a local file, click Data: Connect to File: PLEXON and select the file. To connect to web data, click Data: Connect to Web and enter the URL. 
  3. In the data selection dialog, you can double-click on the first row of Contents to select all variables, then click OK to connect to the selected variables.
  4. Once a connector is added, click the connector icon in the upper-left corner of the book to open a popup menu with various commands.
  5. By default, connector-imported data are NOT saved with the project file. To save a book's data with the project file, click the connector icon in the upper-left corner for that book and uncheck Exclude Imported When Saving. Note that each book has its own Exclude setting.
LabTalk

You can use LabTalk script to import data from a PL2 file in the follow 2 methods:

1. Call Data Connector Methods

  1. Add PLEXON connector to workbook
    wbook.dc.add("PLEXON");
  2. Set Connector Source
    wks.dc.source$ = _pl2_file_full_path_;
  3. Select entries to connect
    • To select all available entries
      wks.dc.sel$ = "PLEXON";
    • To select all available entries of Continuous/Waveform/Timestamps
      wks.dc.sel$ = "PLEXON/Continuous"; // all Continuous entries
      wks.dc.sel$ = "PLEXON/Waveform";   // all Waveform entries
      wks.dc.sel$ = "PLEXON/Timestamps"; // all Timestamps entries
      wks.dc.sel$ = "PLEXON/Markers"; // all Markers entries
    • To select one entry
      wks.dc.sel$ = "PLEXON/Waveform/SPK01";
  4. Import the selected entries
    wks.dc.import();

2. Call Origin C Functions

  1. Load Origin C prior to opening any PL2 file:
    run.LoadOC(%@APLEXON Connector\OPL2FileReader, 16);
  2. Open a PL2 file, an integer ID representing the file will be returned:
    int nID = PL2open(_pl2_file_full_path_);  // _plx_file_full_path_, non-ASCII in file name is NOT supported
  3. Get the name(s) of available variables:
    string timestamps$ = PL2_Timestamps(nID)$; // timestamp names separated by '\n'
    string continuous$ = PL2_Continuous(nID)$; // continuous names separated by '\n'
    string waveforms$ = PL2_Waveforms(nID)$;   // waveform names separated by '\n'
    string markers$ = PL2_Markers(nID)$;   // marker names separated by '\n'
  4. Select variable(s) to import:
    StringArray saTimestamps = {EVT01, EVT02};  // names of timestamps to import
    StringArray saContinuous = {WB01, WB02};    // names of continuous to import
    StringArray saWaveforms = {SPK01, SPK02};   // names of waveforms to import
    StringArray saMarkers = {CPX1};   // names of markers to import
  5. Import the selected variable(s) into an existing worksheet, say, [Book1]Sheet1:
    PL2_GetTimestamps(nID, [Book1]Sheet1, saTimestamps);  // import specific timestamps
    PL2_GetContinuous(nID, [Book1]Sheet1, saContinuous);  // import specific continuous
    PL2_GetWaveforms(nID, [Book1]Sheet1, saWaveforms);    // import specific waveforms
    PL2_GetMarkers(nID, [Book1]Sheet1, saMarkers);    // import specific markers
  6. The loading process should always end by closing the file:
    PL2close(nID);

 

N.B.:

  1. OmniPlex and MAP Offline SDK Bundle is included in this app to read file in PL2 format. It requires both msvcp80.dll and msvcr80.dll. If there is a problem launching this app, you may install the Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package MFC Security Update to fix it.
  2. Non-ASCII in file name may result in problems when connecting to the data.

Updates:

v 1.20: Update DLL dependencies.
v 1.10
Y columns in Timestamps are removed.
Connect to Markers.

Reviews and Comments:

Be the first to review this File Exchange submission.