Configure the FPGA

To configure the FPGA, use a bitfile generated by the Xilinx or Altera tools. Xilinx tools output a bitfile with the extension “.bit” that may be used directly. Altera tools must be setup to output a raw bitfile with the extension “.rbf”. Checking for errors with the ConfigureFPGA method can help flag important errors that may be difficult to identify later in the application. Note that ConfigureFPGA requires a bitfile to be specified, as it will not automatically detect an available bitfile.

Important Note: When configuring using  a specific bitfile, make sure that the bitfile is in the working directory of the application, which may or may not be the same directory as the source file or executable.

C/C++

okCFrontPanel dev;
okCFrontPanel::ErrorCode error;
 
dev.OpenBySerial();
error = dev.ConfigureFPGA(“video_capture.bit”);
// It’s a good idea to check for errors here!!Code language: PHP (php)

C#

okCFrontPanel dev = new okCFrontPanel();
okCFrontPanel::ErrorCode error;
string bitfile = "video_capture.bit";
dev.OpenBySerial("");
error = dev.ConfigureFPGA(bitfile);
// It’s a good idea to check for errors here!!Code language: PHP (php)

Python

dev = ok.okCFrontPanel()
dev.OpenBySerial("")
error = dev.ConfigureFPGA(“video_capture.bit”)
# It’s a good idea to check for errors here!!Code language: PHP (php)

Java

public class example{
	okCFrontPanel dev;
	okCFrontPanel.ErrorCode error;
 
	public void Configure(){
		dev = new okCFrontPanel();
		dev.OpenBySerial(“”);
		error = dev.ConfigureFPGA(“video_capture.bit”);
		// It’s a good idea to check for errors here!!
	}
}Code language: PHP (php)