Callback function in ConfigureFPGA C++

I have been trying to write a callback function to work with the ConfigureFPGA function to track the bitfile download progress but have been having trouble. Here is a snippet of code that I’ve written to test/debug the function call:

[CODE] okCFrontPanel::ErrorCode temp;
int val = 0;
int *test = &val;

// Download configuration bitfile to FPGA.
temp = xem->ConfigureFPGA("./xilinx/flimControl/flimControl.bit",
configDownloadStatus, test);
// configDownloadStatus(1,2,test);
cout << "Error Code: " << temp << endl;
cout << "Test: " << val << endl;[/CODE]

The associated callback function is:

void configDownloadStatus(int length, int count, void *arg){ *(int*)arg=100; printf("This is a test."); cout << "length " << length << " count " << count << endl; }

If I execute the code above (after successfully opening FrontPanel and the device), I get the following output:

Error Code: 0 Test: 0

If I uncomment the configDownloadStatus(1,2,test); line, I get the following:

Error Code: 0 Test: 100

So, it looks like in both cases the bitfile is being loaded successfully but the callback function is not being executed from the ConfigureFPGA call. Does anyone have any suggestions?

It looks as though the callback / arg features aren’t passed with the DLL version of things. We will need to flag this and correct it in the next release.

Configuration occurs so fast, it seems most folks don’t even bother with the callback since no one has pointed this out!

OK sounds good. Like you mentioned, it’s not that critical because the download happens so quickly. Thanks for taking the time to look into it.