PCAN - Matlab Dll Issue

This forum covers third party software that is for example developed with our APIs

PCAN - Matlab Dll Issue

Postby pietmanheyns » Mon 7. May 2012, 11:16

Hi all,

I am using a PEAK CAN-USB converter (item number IPEH-002021) to communicate with a servo drive via matlab. I only recently started using load-library files in Matlab and I'm having a bit of difficulty communicating to the PCAN converter using matlab.

I loaded the pcanbasic.dll file with the pcanbasic.h headerfile using the loadlibrary function, the library gets loaded and I can view the functions using the libfunctions('libname') file, but its loaded with a lot of errors (Warning: The data type 'error' used by function CAN_initialize does not exist).

When I try calling a function using calllib function, I get the error: Error using ==> calllib, no method with matching signature.

Has anyone come across this problem or does anyone know what I am doing wrong?

Any help would be greatly appreciated.
Kind regards,

Pieter
pietmanheyns
 
Posts: 2
Joined: Mon 7. May 2012, 11:05

Re: PCAN - Matlab Dll Issue

Postby M.Maidhof » Mon 7. May 2012, 11:32

Hi,

did you see the following post with some Matlab examples for PCAN-Light:

viewtopic.php?f=41&t=110#p313

perhaps this will help

regards

Michael
User avatar
M.Maidhof
Support
Support
 
Posts: 200
Joined: Wed 22. Sep 2010, 14:00
Location: Darmstadt, Germany

Re: PCAN - Matlab Dll Issue

Postby pietmanheyns » Mon 7. May 2012, 12:06

Hi Michael,

Thank you for the reply and the info.
I'm not using simulink at all to communicate to the PCAN module, the comments and information of the post is not applicable to my problem.
Thank you anycase.
Regards,
Pieter
pietmanheyns
 
Posts: 2
Joined: Mon 7. May 2012, 11:05

Re: PCAN - Matlab Dll Issue

Postby U.Wilhelm » Tue 22. May 2012, 09:37

We also have a simple MATLAB implementation (without ANY support) free of charge for the older PCAN-Light API (unzip with PW: peak)
PCAN-USB-MatLab.zip
Simple MatLab interface for PCAN-USB using PCAN-Light
(51.15 KiB) Downloaded 159 times
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------
User avatar
U.Wilhelm
Sales & Support
Sales & Support
 
Posts: 247
Joined: Fri 10. Sep 2010, 19:34
Location: Darmstadt

Re: PCAN - Matlab Dll Issue

Postby jvdl » Fri 30. Nov 2012, 16:08

Hi,

i am getting the following error when i amtrying to compile the matlab dll on my win7 64 bit machine.

>> Build_DLL
build CANUSB_CLOSE.c
Creating library C:\Users\VONDER~1\AppData\Local\Temp\mex_yACS_i\templib.x and object C:\Users\VONDER~1\AppData\Local\Temp\mex_yACS_i\templib.exp
CANUSB_CLOSE.obj : error LNK2019: unresolved external symbol CAN_Close referenced in function mexFunction
CANUSB_CLOSE.mexw64 : fatal error LNK1120: 1 unresolved externals

C:\PROGRA~1\MATLAB\R2012B\BIN\MEX.PL: Error: Link of 'CANUSB_CLOSE.mexw64' failed.

Error using mex (line 206)
Unable to complete successfully.

Error in Build_DLL (line 2)
mex CANUSB_CLOSE.c PCAN_USB.lib

Does anyone have an idea what's the problem?

Thx in advance!
jvdl
 
Posts: 7
Joined: Tue 17. Jan 2012, 18:06

Re: PCAN - Matlab Dll Issue

Postby U.Wilhelm » Fri 30. Nov 2012, 16:36

The LIB file´s are 32Bit LIB´s and could not used to create 64Bit code.
Please Download the latest 32/64Bit Light package and use the 64Bit LIBs on a 64Bit System.
DOWNLOAD PCAN-Light package
--------------------------------
PEAK-System Technik
Technical Support Team
support@peak-system.com
-------------------------------
User avatar
U.Wilhelm
Sales & Support
Sales & Support
 
Posts: 247
Joined: Fri 10. Sep 2010, 19:34
Location: Darmstadt

Re: PCAN - Matlab Dll Issue

Postby jvdl » Mon 3. Dec 2012, 11:54

Thanks a lot!
jvdl
 
Posts: 7
Joined: Tue 17. Jan 2012, 18:06


Return to Third Party Software



cron