Matlab Error

Hi all - I need a bit of help on using the Matlab API

The following Matlab script results in the errors (shown in comments)

addpath('C:\Program Files\Opal Kelly\FrontPanel\API\Matlab');
addpath('C:\Program Files\Opal Kelly\FrontPanel\API');
[m,s] = ok_getdevicelist()
xem = okusbxem3001v2();

isopen(xem)
% 0
display(xem)
% XEM3001v2:
%    NO DEVICE OPEN.
getserialnumber(xem)
% 
% ans =
% 
% libpointer
xem = openbyserial(xem, '')
% XEM3001v2:
% Firmware revision: 2.4
% ??? Error using ==> sprintf
% Function is not defined for 'lib.pointer' inputs.
% 
% Error in ==> okusbfrontpanel.display at 14
% 	stg = sprintf('    Serial number: %s', getserialnumber(obj));
% 
% Error in ==> okusbxem3001v2.display at 9
% display(obj.okusbfrontpanel)

Can anyone inform me what I’m doing wrong here? The equivalent code in Python works nicely:

import ok
bitfile = r'c:\xem\comm\comm.bit'
dev = ok.XEM3001v2( )
if not dev.IsOpen( ):
    dev.OpenBySerial( '' )
dev.ConfigureFPGA( bitfile )

Can you tell me the file versions you’re working with? Primarily okfrontpanel/display.m, the date of the okFrontPanel.dll and the file version of the okFrontPanelDLL.h

The file version is just the Rev number in the file (near the top).

Matlab can be somewhat picky with getting everything just right. The versions I’m working with here work just fine, but I want to make sure we’re on the same page.

Whoops - should have realized to include that information. I’m using release 1.3.1 from the CDROM supplied with the XEM3001v2 board.

Timestamps & Versions are as follows:

okFrontPanel.dll
Saturday, December 10, 2005, 2:57:09 PM

okFrontPanelDLL
Rev: 235 Date: 2005-12-10 13:58:58 -0600 (Sat, 10 Dec 2005)

@okusbfrontpanel/display.m*
Thursday, October 13, 2005, 9:56:16 PM

Thanks much,
Bo

  • is this the right file? You specified ‘okfrontpanel/display.m’

Bo-

Here’s an updated version of the header file. As I said, Matlab is a bit finicky and the library interface doesn’t provide much feedback to help debug things. Hope this helps.

If it doesn’t work for you, I’ll zip up the entire version we have as latest.


okFrontPanelDLL.zip (1964 Bytes)

So far so good. Thanks!

I had the same type of problems as the original poster. I substituted the header file under C:\Program Files\Opal Kelly\FrontPanel\API\Matlab by the one provided. Now I get the following error messages:

loadlibrary(‘okFrontPanel’, ‘okFrontPanelDLL.h’);
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(…)
In loadlibrary at 277
Warning: The function ‘okFrontPanelDLL_LoadLib’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okFrontPanelDLL_FreeLib’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okCPLL22393_GetReference’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3001v1_Construct’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3001v2_Construct’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3010_Construct’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3001v1_Destruct’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3001v2_Destruct’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3010_Destruct’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3010_GetEepromPLLConfiguration’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3010_SetEepromPLLConfiguration’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3010_GetPLLConfiguration’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbXEM3010_SetPLLConfiguration’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbFrontPanel_Open’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbFrontPanel_GetPLLConfiguration’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbFrontPanel_SetPLLConfiguration’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbFrontPanel_GetEepromPLLConfiguration’ was not found in the library
In loadlibrary at 321
Warning: The function ‘okUsbFrontPanel_SetEepromPLLConfiguration’ was not found in the library
In loadlibrary at 321

Any suggestions?

That post is one year old. You might have substituted the newer version with an older one