Hi all,

I am a junior user of opal kelly. I find some error when I compile the code in matlab, so that I hope that the error can be solved by yours kindly help.

I am using the Xilinx 3 XC3S400. The code is saved as function(fx) file (.m).

Undefined function or variable ‘matlab’.

Error in TOP (line 41)

loadlibrary(‘okFrontPanel’, sprintf(’%s\okFrontPanelDLL.h’, matlab));

parts of code:

try

calllib(‘okFrontPanel’, ‘okUsbFrontPanel_Destruct’, fpga.ptr); % void port confiliction, otherwise the usb port and power supply should be re-pluged.

end

%clear all;

currentDir = pwd;

%add API references

APIpath_matlab = ‘C:\Program Files\Opal Kelly\FrontPanelUSB\API32\Matlab’;

APIpath = ‘C:\Program Files\Opal Kelly\FrontPanelUSB\API32’;

addpath(APIpath_matlab);

addpath(APIpath);

if ~libisloaded(‘okFrontPanel’)

%loadlibrary(‘okFrontPanel’, ‘okFrontPanelDLL.h’);

loadlibrary(‘okFrontPanel’, sprintf(’%s\okFrontPanelDLL.h’, mtlab));

How can I solve this problem? I have already put the okFrontPanelDLL.h in the folder of the corresponding path.

It will be great that if anyone can solve this problem.

Thanks.