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 addusing namespace OpalKellyLegacy; - Data port separation — Wire, Trigger, Pipe, Register,
ResetFPGA, andSetBTPipePollingIntervaloperations move fromokCFrontPanelto a dedicatedOpalKelly::FPGADataPortClassicobject. - Device opening —
OpenBySerial()and device-listing methods are removed. UseOpalKelly::FrontPanelDevicesinstead. - Standalone error codes —
okCFrontPanel::ErrorCodebecomes a freestandingenum class ErrorCode. - Removed deprecated methods — Several convenience methods are removed in favor of
GetDeviceInfo().
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 Name | Preferred name |
|---|---|
| okCFrontPanel | OpalKelly::FrontPanel |
| okCDeviceSettings | OpalKelly::DeviceSettings |
| okCDeviceSensors | OpalKelly::DeviceSensors |
| okCPLL22150 | OpalKelly::PLL22150 |
| okCPLL22393 | OpalKelly::PLL22393 |
| okCFPGADataPortClassic | OpalKelly::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()→ useGetErrorMessage(ErrorCode)insteadEnableAsynchronousTransfers()— removed, no replacementIsFrontPanel3Supported()— removed, no replacementokCDeviceSettingNamesclass — useOpalKelly::DeviceSettings::List(std::vector<std::string>&)insteadGetDeviceListModel()→ useOpalKelly::FrontPanelDevices(see Step 3)GetBoardModelString(model)→ useinfo.productNamefromOpalKelly::GetDeviceInfo()instead
C API: The corresponding okFrontPanel_Get* functions are removed. Use okFrontPanel_GetDeviceInfo() to populate okTDeviceInfo.
Migration Checklist
- Replace
OpenBySerial()withOpalKelly::FrontPanelDevices().Open() - Replace removed convenience methods with
GetDeviceInfo() - Add
GetFPGADataPortClassic()call afterConfigureFPGA() - Redirect wire/trigger/pipe/register/ResetFPGA calls to the data port
- Replace
okCFrontPanel::ErrorCode/okCFrontPanel::NoErrorwith OpalKelly::ErrorCode/ OpalKelly::ErrorCode::NoError - Replace
GetErrorString()withGetErrorMessage() - Replace
okC-prefixed class names withOpalKelly::equivalents (recommended) - Recompile and fix remaining type errors