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.

Test the FrontPanel Interface

After configuring the FPGA with your desired bitfile, it’s a good idea to test that FrontPanel is enabled in your FPGA configuration using okCFrontPanel::IsFrontPanelEnabled(). Testing FrontPanel after configuration is a good way to check for a variety of issues. For example,

  • It assures that the bitfile was found and transferred to the device.
  • It assures that the bitfile has proper host interface pin mappings.
okCFrontPanel dev;
okCFrontPanel::ErrorCode error;
dev.OpenBySerial();
error = dev.ConfigureFPGA("example.bit");
// It's a good idea to check for errors here!!

// IsFrontPanelEnabled returns true if FrontPanel is detected.
if (true == dev.IsFrontPanelEnabled()) {
     std::cout << "FrontPanel host interface enabled.\n";
} else{
     std::cerr << "FrontPanel host interface not detected.\n";
}
okCFrontPanel dev = new okCFrontPanel();
okCFrontPanel::ErrorCode error = new okCFrontPanel::ErrorCode();
string bitfile = "example.bit";
dev.OpenBySerial("");
error = dev.ConfigureFPGA(bitfile);
// It's a good idea to check for errors here!!

// IsFrontPanelEnabled returns true if FrontPanel is detected.
if (true == dev.IsFrontPanelEnabled()){
     Console.Error.WriteLine("FrontPanel host interface enabled.");
} else{
     Console.WriteLine("FrontPanel host interface not detected.");
}
dev = ok.okCFrontPanel()
dev.OpenBySerial("")
error = dev.ConfigureFPGA("example.bit")
# It's a good idea to check for errors here!!

# IsFrontPanelEnabled returns true if FrontPanel is detected.
if true == dev.IsFrontPanelEnabled():
     print "FrontPanel host interface enabled."
else:
     sys.stderr.write("FrontPanel host interface not detected.")
public class example{
     okCFrontPanel dev;
     okCFrontPanel.ErrorCode error;
	
     public void CheckFP(){
          dev = new oKCFrontPanel();
          dev.OpenBySerial("");
          error = dev.ConfigureFPGA("example.bit");
          // It’s a good idea to check for errors here!

          // Is FrontPanelEnabled returns true if FrontPanel is detected.
          if(true == dev.IsFrontPanelEnabled()){
               System.out.println("FrontPanel interface is enabled.");
          }
               System.out.println("FrontPanel interface is not enabled!");
     }
}