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
- Click on the App icon to open the dialog when a worksheet without Data Connector is activated.
- Choose the file to connect:
- To connect to a local file, select the file and click on the Open button to bring up the data selection dialog.
- 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.
- In the data selection dialog, you can double-click on the first row of Contents to select all variables.
- Click on the OK button to connect to the selected variables. Data will be imported into multiple worksheets of the active workbook.
- 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
- 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";
- 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)$;
- Select variable(s) to import:
StringArray saTimestamps = {EVT01, EVT02};
StringArray saContinuous = {WB01, WB02};
StringArray saWaveforms = {SPK01, SPK02};
- 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);
- 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.