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
- With a worksheet active, click on the Data menu.
- 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.
- 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.
- 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.
- 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
- Add PLEXON connector to workbook
wbook.dc.add("PLEXON");
- Set Connector Source
wks.dc.source$ = _pl2_file_full_path_;
- 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";
wks.dc.sel$ = "PLEXON/Waveform";
wks.dc.sel$ = "PLEXON/Timestamps";
wks.dc.sel$ = "PLEXON/Markers";
- To select one entry
wks.dc.sel$ = "PLEXON/Waveform/SPK01";
- Import the selected entries
wks.dc.import();
2. Call Origin C Functions
- Load Origin C prior to opening any PL2 file:
run.LoadOC(%@APLEXON Connector\OPL2FileReader, 16);
- Open a PL2 file, an integer ID representing the file will be returned:
int nID = PL2open(_pl2_file_full_path_);
- Get the name(s) of available variables:
string timestamps$ = PL2_Timestamps(nID)$;
string continuous$ = PL2_Continuous(nID)$;
string waveforms$ = PL2_Waveforms(nID)$;
string markers$ = PL2_Markers(nID)$;
- Select variable(s) to import:
StringArray saTimestamps = {EVT01, EVT02};
StringArray saContinuous = {WB01, WB02};
StringArray saWaveforms = {SPK01, SPK02};
StringArray saMarkers = {CPX1};
- Import the selected variable(s) into an existing worksheet, say,
[Book1]Sheet1
:
PL2_GetTimestamps(nID, [Book1]Sheet1, saTimestamps);
PL2_GetContinuous(nID, [Book1]Sheet1, saContinuous);
PL2_GetWaveforms(nID, [Book1]Sheet1, saWaveforms);
PL2_GetMarkers(nID, [Book1]Sheet1, saMarkers);
- The loading process should always end by closing the file:
PL2close(nID);
N.B.:
- 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.
- Non-ASCII in file name may result in problems when connecting to the data.