Skip to content

Commit e869edf

Browse files
authored
Merge pull request #450 from open-ephys/issue-430
Add 1 second delay before applying port voltage to headstage-64
2 parents c22cf83 + 965f4cb commit e869edf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

OpenEphys.Onix1/ConfigureHeadstage64.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,17 @@ internal override IEnumerable<IDeviceConfiguration> GetDevices()
148148

149149
class ConfigureHeadstage64PortController : ConfigurePortController
150150
{
151+
152+
protected override bool ConfigurePortVoltageOverride(DeviceContext device, double voltage)
153+
{
154+
// NB: Wait for 1 second to discharge the headstage in the case that they have e.g. just
155+
// restarted the workflow automatically with nearly no delay from the last run.
156+
Thread.Sleep(1000);
157+
device.WriteRegister(PortController.PORTVOLTAGE, (uint)(voltage * 10));
158+
Thread.Sleep(500);
159+
return CheckLinkState(device);
160+
}
161+
151162
protected override bool ConfigurePortVoltage(DeviceContext device, out double voltage)
152163
{
153164
// WONTFIX: It takes a huge amount of time to get to 0, almost 10 seconds. The best we can do
@@ -159,6 +170,10 @@ protected override bool ConfigurePortVoltage(DeviceContext device, out double vo
159170
const double VoltageOffset = 3.4;
160171
const double VoltageIncrement = 0.2;
161172

173+
// NB: Wait for 1 second to discharge the headstage in the case that they have e.g. just
174+
// restarted the workflow automatically with nearly no delay from the last run.
175+
Thread.Sleep(1000);
176+
162177
// Start with highest voltage and ramp it down to find lowest lock voltage
163178
voltage = MaxVoltage;
164179
for (; voltage >= MinVoltage; voltage -= VoltageIncrement)

0 commit comments

Comments
 (0)