FP6 Migration Guide

FrontPanel 6.0 makes five breaking changes to the C/C++ API:

  • C++ namespace change — Legacy okC-prefixed class names are no longer in the global namespace; use OpalKelly:: qualified names instead or add using namespace OpalKellyLegacy;
  • Data port separation — Wire, Trigger, Pipe, Register, ResetFPGA, and SetBTPipePollingInterval operations move from okCFrontPanel to a dedicated OpalKelly::FPGADataPortClassic object.
  • Device openingOpenBySerial() and device-listing methods are removed. Use OpalKelly::FrontPanelDevices instead.
  • Standalone error codesokCFrontPanel::ErrorCode becomes a freestanding enum class ErrorCode.
  • Removed deprecated methods — Several convenience methods are removed in favor of GetDeviceInfo().

Migrate with Claude Code

Download the skill from Opal Kelly Pins and place it in your projects .claude/skills folder. Then ask Claude Code to migrate your source files — it will apply every breaking change documented below automatically.

C++ Namespace Note

FrontPanel 6.0 provides all C++ classes under the preferred OpalKelly:: namespace. Legacy okC-prefixed names are no longer in the global namespace but are available in the alternate OpalKellyLegacy:: namespace — see Step 1 for migration options.

New code should use the OpalKelly:: names. A future release will remove the legacy names.

Legacy NamePreferred name
okCFrontPanelOpalKelly::FrontPanel
okCDeviceSettingsOpalKelly::DeviceSettings
okCDeviceSensorsOpalKelly::DeviceSensors
okCPLL22150OpalKelly::PLL22150
okCPLL22393OpalKelly::PLL22393
okCFPGADataPortClassicOpalKelly::FPGADataPortClassic

The examples below use the preferred OpalKelly:: names throughout.

C++ Namespace Change

FrontPanel 6.0 removes the using namespace OpalKellyLegacy; statement from okFrontPanel.h. In FP5, legacy class names like okCFrontPanel were automatically available in the global namespace. In FP6, they are not.

Quick Migration

If you want existing code to compile with minimal changes, add this line after #include "okFrontPanel.h":

using namespace OpalKellyLegacy;Code language: C++ (cpp)

This restores the FP5 behavior where all legacy names are globally accessible. This allows you to migrate to OpalKelly:: names incrementally.

Recommended Approach

Use the OpalKelly:: namespace aliases:

  // FP5:
  okCFrontPanel dev;
  okCPLL22150 pll;
  okCFPGADataPortClassic* port;

  // FP6:
  OpalKelly::FrontPanel dev;      // or auto dev = OpalKelly::FrontPanelDevices().Open();
  OpalKelly::PLL22150 pll;
  OpalKelly::FPGADataPortClassic* port;Code language: C++ (cpp)

Update Device Opening

// FP5:
okCFrontPanel dev;
dev.OpenBySerial("");

// FP6:
OpalKelly::FrontPanelPtr dev = OpalKelly::FrontPanelDevices().Open();Code language: C++ (cpp)

Open() returns an std::unique_ptr<OpalKelly::FrontPanel>. Pass a serial number to open a specific device, or omit it to open the first available device.

To enumerate devices, use OpalKelly::FrontPanelDevices:

OpalKelly::FrontPanelDevices devices;
for (int i = 0; i < devices.GetCount(); i++)
    std::string serial = devices.GetSerial(i);Code language: C++ (cpp)

C API: Replace okFrontPanel_OpenBySerial() with okFrontPanelDevices_Construct() + okFrontPanelDevices_Open().

Obtain the Classic Data Port

After configuring the FPGA, obtain a pointer to OpalKelly::FPGADataPortClassic and redirect all wire, trigger, pipe, register, ResetFPGA, and SetBTPipePollingInterval calls through it:

// FP5:
dev.ConfigureFPGA("my_design.bit");
dev.SetWireInValue(0x00, 0x01);
dev.UpdateWireIns();

// FP6:
dev->ConfigureFPGA("my_design.bit");

OpalKelly::FPGADataPortClassic* classicPort = nullptr;
OpalKelly::ErrorCode ec = dev->GetFPGADataPortClassic(classicPort);

if (ec == OpalKelly::ErrorCode::NoError) {
    classicPort->SetWireInValue(0x00, 0x01);
    classicPort->UpdateWireIns();
}Code language: C++ (cpp)

The method names and parameters are identical — only the target object changes. This applies to all wire, trigger, pipe, register, ResetFPGA, and SetBTPipePollingInterval calls.

The pointer is owned by the OpalKelly::FrontPanel instance — do not delete it.

C API: The same pattern applies — okFrontPanel_* data functions become okFPGADataPortClassic_* functions with an okFPGADataPortClassic_HANDLE obtained via okFrontPanel_GetFPGADataPortClassic()`.

Update Error Codes

okCFrontPanel::ErrorCode is now a standalone enum class ErrorCode:

// FP5:
okCFrontPanel::ErrorCode ec = dev.ConfigureFPGA("design.bit");
if (ec != okCFrontPanel::NoError) { ... }

// FP6:
OpalKelly::ErrorCode ec = dev->ConfigureFPGA("design.bit");
if (ec != OpalKelly::ErrorCode::NoError) { ... }Code language: C++ (cpp)

The pattern is consistent: okCFrontPanel::X becomes OpalKelly::ErrorCode::X for all values. As an enum class, implicit integer conversions are no longer allowed — use static_cast<int>(ec) where needed.

This also applies to OpalKelly::DeviceSettings methods, which now return OpalKelly::ErrorCode instead of okCFrontPanel::ErrorCode.

Replace Removed Convenience Methods

Several methods are removed in favor of GetDeviceInfo():

// FP5:
std::string serial = dev.GetSerialNumber();
okCFrontPanel::BoardModel model = dev.GetBoardModel();
int major = dev.GetDeviceMajorVersion();
int minor = dev.GetDeviceMinorVersion();
bool fast = dev.IsHighSpeed();
int width = dev.GetHostInterfaceWidth();

// FP6:
okTDeviceInfo info;
dev->GetDeviceInfo(&info);
// info.serialNumber, info.deviceID, info.productName,
// info.productID, info.deviceMajorVersion, info.deviceMinorVersion,
// info.usbSpeed, info.wireWidthCode language: C++ (cpp)

The okCFrontPanel::BoardModel enum is removed. Use okTDeviceInfo::productID with OK_PRODUCT_* constants.

Other removals:

  • GetErrorString() → use GetErrorMessage(ErrorCode) instead
  • EnableAsynchronousTransfers() — removed, no replacement
  • IsFrontPanel3Supported() — removed, no replacement
  • okCDeviceSettingNames class — use OpalKelly::DeviceSettings::List(std::vector<std::string>&) instead
  • GetDeviceListModel() → use OpalKelly::FrontPanelDevices (see Step 3)
  • GetBoardModelString(model) → use info.productName from OpalKelly::GetDeviceInfo() instead

C API: The corresponding okFrontPanel_Get* functions are removed. Use okFrontPanel_GetDeviceInfo() to populate okTDeviceInfo.

Migration Checklist

  • Replace OpenBySerial() with OpalKelly::FrontPanelDevices().Open()
  • Replace removed convenience methods with GetDeviceInfo()
  • Add GetFPGADataPortClassic() call after ConfigureFPGA()
  • Redirect wire/trigger/pipe/register/ResetFPGA calls to the data port
  • Replace okCFrontPanel::ErrorCode / okCFrontPanel::NoError with OpalKelly::ErrorCode / OpalKelly::ErrorCode::NoError
  • Replace GetErrorString() with GetErrorMessage()
  • Replace okC-prefixed class names with OpalKelly:: equivalents (recommended)
  • Recompile and fix remaining type errors