-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Read data from Ph2C probe (see notes.txt)
- Loading branch information
1 parent
6791610
commit a865069
Showing
6 changed files
with
1,144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Compiled plugin w/ API 3.67 by commenting out all code related to setting SYNC param. | ||
Initially plugin wouldn't load. Dependency walker showed it was linking to NeuropixAPI_x64_3_67_dbg.dll. | ||
Renaming NeuropixAPI_x64_3_67.dll to NeuropixAPI_x64_3_67_dbg.dll enabled the plugin to load properly. | ||
|
||
I was able to connect to one headstage and one probe: | ||
|
||
[open-ephys] Scanning for devices... | ||
[open-ephys] Found 1 device. | ||
[open-ephys] Opening device on slot 4 | ||
[open-ephys] Opened BS on slot 4 | ||
[open-ephys] BS firmware: 2.0169 | ||
[open-ephys] Searching for probes... | ||
[open-ephys] Got HS part #: NPM_HSTC_ext <-- Do we ignore this part #? | ||
[open-ephys] Got HS part #: NPM_HS_32 | ||
[open-ephys] Found 2.0 Phase 2C dual-dock headstage on port: 1 | ||
[open-ephys] No headstage detected on port: 3 | ||
[open-ephys] No headstage detected on port: 4 | ||
[open-ephys] Found probe part number: NP2020 | ||
[open-ephys] Found probe serial number: 22053112201 | ||
|
||
On subsequent connections randomly getting either error code 8 OR 2.0 probe headstage number: | ||
|
||
[open-ephys] ***detectHeadstage failed w/ error code: 8 | ||
[open-ephys] Got HS part #: NPM_HS_01 | ||
|
||
TODO: Add Geometry next so probe gets validated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
/* | ||
------------------------------------------------------------------ | ||
This file is part of the Open Ephys GUI | ||
Copyright (C) 2024 Allen Institute for Brain Science and Open Ephys | ||
------------------------------------------------------------------ | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "Headstage_Ph2C.h" | ||
#include "../Probes/Neuropixels_Ph2C.h" | ||
|
||
#define MAXLEN 50 | ||
|
||
void Headstage_Ph2C::getInfo() | ||
{ | ||
|
||
int version_major; | ||
int version_minor; | ||
|
||
errorCode = Neuropixels::getHSVersion(basestation->slot, port, &version_major, &version_minor); | ||
|
||
info.version = String(version_major) + "." + String(version_minor); | ||
|
||
errorCode = Neuropixels::readHSSN(basestation->slot, port, &info.serial_number); | ||
|
||
char pn[MAXLEN]; | ||
errorCode = Neuropixels::readHSPN(basestation->slot, port, pn, MAXLEN); | ||
|
||
info.part_number = String(pn); | ||
|
||
} | ||
|
||
|
||
void Flex_Ph2C::getInfo() | ||
{ | ||
|
||
int version_major; | ||
int version_minor; | ||
|
||
errorCode = Neuropixels::getFlexVersion(headstage->basestation->slot, | ||
headstage->port, | ||
dock, | ||
&version_major, | ||
&version_minor); | ||
|
||
info.version = String(version_major) + "." + String(version_minor); | ||
|
||
char pn[MAXLEN]; | ||
errorCode = Neuropixels::readFlexPN(headstage->basestation->slot, | ||
headstage->port, | ||
dock, | ||
pn, | ||
MAXLEN); | ||
|
||
info.part_number = String(pn); | ||
|
||
} | ||
|
||
|
||
Headstage_Ph2C::Headstage_Ph2C(Basestation* bs_, int port) : Headstage(bs_, port) | ||
{ | ||
getInfo(); | ||
|
||
int count; | ||
|
||
Neuropixels::getHSSupportedProbeCount(basestation->slot, port, &count); | ||
|
||
for (int dock = 1; dock <= count; dock++) | ||
{ | ||
bool flexDetected; | ||
|
||
Neuropixels::detectFlex(basestation->slot, port, dock, &flexDetected); | ||
|
||
if (flexDetected) | ||
{ | ||
flexCables.add(new Flex_Ph2C(this, dock)); | ||
Neuropixels_Ph2C* probe = new Neuropixels_Ph2C(basestation, this, flexCables.getLast(), dock); | ||
|
||
if (probe->isValid) | ||
{ | ||
probe->setStatus(SourceStatus::CONNECTING); | ||
probes.add(probe); | ||
} | ||
else | ||
{ | ||
delete probe; | ||
probes.add(nullptr); | ||
} | ||
|
||
} | ||
else { | ||
probes.add(nullptr); | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
Flex_Ph2C::Flex_Ph2C(Headstage* hs_, int dock) : Flex(hs_, dock) | ||
{ | ||
getInfo(); | ||
|
||
errorCode = Neuropixels::SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
------------------------------------------------------------------ | ||
This file is part of the Open Ephys GUI | ||
Copyright (C) 2024 Allen Institute for Brain Science and Open Ephys | ||
------------------------------------------------------------------ | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef __NEUROPIXHSP2C_H_2C4C2D67__ | ||
#define __NEUROPIXHSP2C_H_2C4C2D67__ | ||
|
||
|
||
#include "../API/v3/NeuropixAPI.h" | ||
#include "../NeuropixComponents.h" | ||
|
||
|
||
class Headstage_Ph2C : public Headstage | ||
{ | ||
public: | ||
Headstage_Ph2C::Headstage_Ph2C(Basestation*, int port); | ||
void getInfo() override; | ||
bool hasTestModule() override { return false; } | ||
void runTestModule() override {} | ||
|
||
Neuropixels::NP_ErrorCode errorCode; | ||
}; | ||
|
||
class Flex_Ph2C : public Flex | ||
{ | ||
public: | ||
Flex_Ph2C::Flex_Ph2C(Headstage*, int dock); | ||
void getInfo() override; | ||
|
||
Neuropixels::NP_ErrorCode errorCode; | ||
}; | ||
|
||
#endif // __NEUROPIXHSP2C_H_2C4C2D67__ |
Oops, something went wrong.