Configure Two Devices

As with opening two separate devices, configuring two separate devices only requires two instances of okCFrontPanel and appropriate bitfiles. To configure the separate devices, call ConfigureFPGA on their okCFrontPanel instances and specify the bitfiles that will be used to configure them. It is easy to mistakenly configure a bitfile to the wrong device when configuring multiple devices at once, so it is a good idea to incorporate a safeguard, such as opening the devices by specifying the serial number or verifying the board model after it is open. It is also a good idea to check for errors after configuration.

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 dev1;
okCFrontPanel dev2;
okCFrontPanel::ErrorCode error;
 
dev1.OpenBySerial("14230005XY");
dev2.OpenBySerial("14230005XZ");
error = dev1.ConfigureFPGA("video_capture_a.bit");
error = dev2.ConfigureFPGA("video_capture_b.bit");
// It’s a good idea to check for errors here!!Code language: PHP (php)

C#

okCFrontPanel dev1 = new okCFrontPanel();
okCFrontPanel dev2 = new okCFrontPanel();
okCFrontPanel::ErrorCode error = new okCFrontPanel::ErrorCode();
dev1.OpenBySerial("14230005XY");
dev2.OpenBySerial("14230005XZ");
error = dev1.ConfigureFPGA("video_capture_a.bit");
error = dev2.ConfigureFPGA("video_capture_b.bit");
// It’s a good idea to check for errors here!!Code language: PHP (php)

Python

dev1 = ok.okCFrontPanel()
dev2 = ok.okCFrontPanel()
dev1.OpenBySerial("14230005XY")
dev2.OpenBySerial("14230005XZ")
error = dev1.ConfigureFPGA("video_capture_a.bit")
error = dev2.ConfigureFPGA("video_capture_b.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(String bitfile, String serial){
		dev = new okCFrontPanel();
		dev.OpenBySerial(serial);
		error = dev.ConfigureFPGA(bitfile);
		// It’s a good idea to check for errors here!!
	}
 
	public static void main(String[] args){
		ConfigFPGA config1 = new ConfigFPGA();
		ConfigFPGA config2 = new ConfigFPGA();
 
		config1.Configure("video_capture_a.bit", "14230005XY");
		config2.Configure("video_capture_b.bit", "14230005XZ");
	}
}Code language: JavaScript (javascript)