FrontPanel SDK Examples

These pages include a number of resources to help make you more productive with our products. Please refer to the following resources if you need a hand.

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.

okCFrontPanel dev;
okCDeviceSettings settings;
UINT32 voltage;
UINT32 en;
UINT32 mode;

// Populate DeviceSettings struct
dev.OpenBySerial();
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();
okCFrontPanel dev = new okCFrontPanel();
okCDeviceSettings settings = new okCDeviceSettings();

// Populate DeviceSettings struct
dev.OpenBySerial("");
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();
dev = ok.okCFrontPanel()
dev.OpenBySerial("")

# 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()
public class devSettings{
     okCFrontPanel device;

     public boolean Initialize(){
     device = new okFrontPanel();
     device.OpenBySerial("");
     }

     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();
     }
}