diff --git a/Packages/MIES/MIES_ForeignFunctionInterface.ipf b/Packages/MIES/MIES_ForeignFunctionInterface.ipf index 056ed44318..d27507472b 100644 --- a/Packages/MIES/MIES_ForeignFunctionInterface.ipf +++ b/Packages/MIES/MIES_ForeignFunctionInterface.ipf @@ -72,3 +72,15 @@ Function/WAVE FFI_GetAvailableMessageFilters() return wv End + +/// @brief Set the headstage/cell electrode name +Function FFI_SetCellElectrodeName(string device, variable headstage, string name) + + DAP_AbortIfUnlocked(device) + ASSERT(IsValidHeadstage(headstage), "Invalid headstage index") + ASSERT(H5_IsValidIdentifier(name), "Name of the electrode/headstage needs to be a valid HDF5 identifier") + + WAVE/T cellElectrodeNames = GetCellElectrodeNames(device) + + cellElectrodeNames[headstage] = name +End diff --git a/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf b/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf index e30560ed55..d138615dd3 100644 --- a/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf +++ b/Packages/tests/HardwareBasic/UTF_BasicHardwareTests.ipf @@ -2473,10 +2473,8 @@ End static Function TestCustomElectrodeNamesInNWB_preAcq(string device) - WAVE/T cellElectrodeNames = GetCellElectrodeNames(device) - // must be valid HDF5 identifiers - cellElectrodeNames[0] = "Electric Dreams of Voltage" - cellElectrodeNames[1] = "Electric Dreams of Current" + FFI_SetCellElectrodeName(device, 0, "Electric Dreams of Voltage") + FFI_SetCellElectrodeName(device, 1, "Electric Dreams of Current") End // UTF_TD_GENERATOR DeviceNameGeneratorMD1