Creat DLL in Simulink with PCAN USB

This forum covers third party software that is for example developed with our APIs
Locked
Jonas
Posts: 1
Joined: Fri 20. Apr 2018, 10:00

Creat DLL in Simulink with PCAN USB

Post by Jonas » Fri 20. Apr 2018, 10:06

Hey,
I’m trying to generate in MATLAB Simulink a DLL via the “rtwbuild(‘Modelname’)” command. The generated DLL works fine. If I add to the Simulink model the CAN blocks (CAN Configuration, CAN Pack and CAN Transmit) from the Vehicle Network Toolbox (independent from the hardware type (PEAK or Vector)) the Model is able to send via the CAN USB adapter, also the DLL generation still produces no errors. But if I run this DLL with the same Java environment as before the hole DLL crashes (runs without an error message but doesn’t work). No CAN messages are transmitted and none of the other functions in the DLL are working.
What do I have to do, to get the CAN communication in the DLL running?


As an alternative solution I tried the 64 bit S-Functions witch were provided here:
http://www.peak-system.com/forum/viewto ... 0&start=20
In Simulink I’m also able to send and read CAN Messages. If I now want to generate the DLL with the rtwbuild the Warning:
The S-function 'VdmeDLL/Test CAN/Init_CAN/Initialisieren/If Action Subsystem/S-Function' has the option
SS_OPTION_WORKS_WITH_CODE_REUSE set but it does not have a 'CAN_ResetFilter.tlc' file. The system that it lives in will not be reused

Is displayed for every used S-Function. Do you know where I can get the needed .tlc files? Or do you have another idea. I would prefer the S-Function solution compared to the Vehicle Network toolbox because this solution seems to be more flexible.

I use Matlab 2015b (64bit) with the corresponding Hardware support packages on a Windows 7(64bit) devices.

Thanks and regards
Jonas

M.Maidhof
Support
Support
Posts: 1286
Joined: Wed 22. Sep 2010, 14:00

Re: Creat DLL in Simulink with PCAN USB

Post by M.Maidhof » Fri 20. Apr 2018, 13:44

Hello Jonas,

please post this problem in a matlab/simulink forum or send it by email to the matlab support. We can`t help in Matlab/Simulink related software questions.

regards

Michael

khushbu kashyap
Posts: 1
Joined: Thu 19. Jul 2018, 10:16

Re: Creat DLL in Simulink with PCAN USB

Post by khushbu kashyap » Thu 19. Jul 2018, 12:09

Hi i am able to solve your issues. It is not very much difficult to create dll file in simulink with PCAN USB. I have also faced the same problem earlier, so can help you, here is the download url ..... msvcp110.dll.
you need to download and install dll file and nd your dll file will be created.

EDIT BY ADMIN - NO LINKS TO EXTERNAL FILES ARE ALLOWED !!

Locked