File Exchange > Data Connector >    PLEXON Connector

Author:
OriginLab Technical Support
Date Added:
2/26/2019
Last Update:
4/23/2019
Downloads (90 Days):
23
Total Ratings:
0
File Size:
108 KB
Average Rating:
File Name:
PLEXON Connector.opx
File Version:
1.00
Minimum Versions:
License:
Free
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

Download the file PLEXON Connector.opx, and then drag-and-drop onto the Origin workspace. An icon will appear in the Apps Gallery window.

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. Click on the App icon to open the dialog when a worksheet without Data Connector is activated.
  2. Choose the file to connect:
    1. To connect to a local file, select the file and click on the Open button to bring up the data selection dialog.
    2. To connect to data from website, enter the URL to the data accordingly. The data selection dialog will be brough up when data is ready.
  3. In the data selection dialog, you can double-click on the first row of Contents to select all variables.
  4. Click on the OK button to connect to the selected variables. Data will be imported into multiple worksheets of the active workbook.
  5. You can click on the Data Connector button on the worksheet to update the connection, for example, change the data source and variable selection.
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
    • 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'
  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
  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
  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:

Reviews and Comments:

Be the first to review this File Exchange submission.