Device Settings API

The Device Settings API allows for software-based control of some signals and voltage and current on the FMC port, as well as temperature control through a fan that can be connected to the two-pin connector (Molex 53398-0271) at JP1.

The following example sets VADJ on the FMC port to 3.3V and sets FMC to draw from FMC_VADJ_VOLTAGE instead of IPMI EEPROM. This sets the FMC Vadj voltage to 3.3V. Note that the resolution on FMC1_VADJ_VOLTAGE does not allow for single-bit precision on the voltage division, such as 331 instead of 330. Consult your device’s User’s Manual for details on valid settings.

To change the settings on your FrontPanel Device Settings API-enabled device, it is recommended that you first retrieve the existing settings from the board, then modify them using the SetInt method. It is a good idea to verify that the settings are correct at this point. You can then load the settings to the board by saving the settings using the Save method. Note that some settings will not take effect until the board is power cycled.

C/C++

  OpalKelly::FrontPanelDevices devices;
  OpalKelly::DeviceSettings settings;
  UINT32 voltage;
  UINT32 en;
  UINT32 mode;

  auto dev = devices.Open();

  // Populate DeviceSettings struct
  dev->GetDeviceSettings(settings);

  // Adjust settings
  settings.SetInt("FMC1_VADJ_VOLTAGE", 330);
  settings.SetInt("FMC1_VADJ_ENABLE", 1);
  settings.SetInt("FMC1_VADJ_MODE", 3);

  // Confirm settings
  settings.GetInt("FMC1_VADJ_VOLTAGE", &voltage);
  settings.GetInt("FMC1_VADJ_ENABLE", &en);
  settings.GetInt("FMC1_VADJ_MODE", &mode);

  // Save settings to the device
  settings.Save();Code language: PHP (php)

C#

  okCFrontPanelDevices devices = new okCFrontPanelDevices();
  okCFrontPanel dev = devices.Open("");

  okCDeviceSettings settings = new okCDeviceSettings();

  // Populate DeviceSettings struct
  dev.GetDeviceSettings(settings);

  // Adjust settings
  settings.SetInt("FMC1_VADJ_VOLTAGE", 330);
  settings.SetInt("FMC1_VADJ_ENABLE", 1);
  settings.SetInt("FMC1_VADJ_MODE", 3);

  // Confirm settings
  Console.WriteLine(settings.GetInt("FMC1_VADJ_VOLTAGE"));
  Console.WriteLine(settings.GetInt("FMC1_VADJ_ENABLE"));
  Console.WriteLine(settings.GetInt("FMC1_VADJ_MODE"));

  // Save settings to the device
  settings.Save();Code language: JavaScript (javascript)

Python

  devices = ok.FrontPanelDevices()
  dev = devices.Open()

  # Populate DeviceSettings struct
  s = ok.okCDeviceSettings()
  dev.GetDeviceSettings(s)

  # Adjust settings
  s.SetInt("FMC1_VADJ_VOLTAGE", 330)
  s.SetInt("FMC1_VADJ_ENABLE", 1)
  s.SetInt("FMC1_VADJ_MODE", 3)

  # Confirm settings
  s.GetInt("FMC1_VADJ_VOLTAGE")
  s.GetInt("FMC1_VADJ_ENABLE")
  s.GetInt("FMC1_VADJ_MODE")

  # Save settings to the device
  s.Save()Code language: PHP (php)

Java

  public class DevSettings {

       okCFrontPanelDevices devices;
       okCFrontPanel device;

       public void Initialize() {
            devices = new okCFrontPanelDevices();
            device = devices.Open("");
       }

       public void Settings() {
            okCDeviceSettings settings = new okCDeviceSettings();

            // Populate DeviceSettings struct
            device.GetDeviceSettings(settings);

            // Adjust settings
            settings.SetInt("FMC1_VADJ_VOLTAGE", 330);
            settings.SetInt("FMC1_VADJ_ENABLE", 1);
            settings.SetInt("FMC1_VADJ_MODE", 3);

            // Confirm settings
            System.out.println(settings.GetInt("FMC1_VADJ_VOLTAGE"));
            System.out.println(settings.GetInt("FMC1_VADJ_ENABLE"));
            System.out.println(settings.GetInt("FMC1_VADJ_MODE"));

            // Save settings to the device
            settings.Save();
       }
  }Code language: PHP (php)

JavaScript

const deviceManager = window.FrontPanelAPI.deviceManager;
const dev = await deviceManager.openDevice("");

try {
     const settings = await dev.getDeviceSettings();

     // Adjust settings
     await settings.setValue("FMC1_VADJ_VOLTAGE", 330);
     await settings.setValue("FMC1_VADJ_ENABLE", 1);
     await settings.setValue("FMC1_VADJ_MODE", 3);

     // Confirm settings
     const voltage = await settings.getValue("FMC1_VADJ_VOLTAGE");
     const en = await settings.getValue("FMC1_VADJ_ENABLE");
     const mode = await settings.getValue("FMC1_VADJ_MODE");

     // Save settings to the device
     await settings.save();
}
catch (e) {
  console.log("Failed to adjust device settings: ", e);
}Code language: JavaScript (javascript)