Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I connect a Simulink-MDL to NI-CAN

Hi all… I’m a new LabView user 😞
I have a Simulink model that should run on a RT-PXI system, the models Input is an 8 Byte 1-D array and the output also, these are representing the 8 bytes Data from CAN. So the Model receives a CAN – Messages, process those and send CAN message(s) as result.

I’m using SIT to generate a NI-DLL from the Model, from LabView I want to “connect” the model to the CAN Hardware (PXI-8461) using NI-CAN.

Can anyone tell me how I could do this easily? Which one of the VIs generate by SIT should I use?

Answers in French and German are also welcome
Thanks
0 Kudos
Message 1 of 4
(4,154 Views)
Hi deeloc,
The readme-file of SIT 2.0.x says, that
"the Simulation Interface Toolkit does not support complex parameters, complex model inputs, and complex model outputs when converting a Simulink model into a model DLL. Only the Simulink environment supports complex parameters, complex model inputs, and complex model outputs."
If you want to run your model on a real-time target, you should convert the exchanged data into scalar elements.
0 Kudos
Message 2 of 4
(4,133 Views)
Hi Tobel..
Thy for the interest...
I understand what u mean, but that was not really my problem, just imagine my simulink model like a blackbox with one input(1x8bytes) array and one output array (1x8bytes,these 8 bytes are just data from or for a CAN Frame (ID and so on not include. so i was trying, after creating the dll, to connect it with a CAN interface throught Labview's NI CAN .
In the meantime,I have realized that the dll created has 8 inputs and 8 outputs. i understand quite what it means...

i finally modify the model_driver_base.vi to solve the problem, it works but i don't know if this is the best solution. Maybe someone knows more....
Message 3 of 4
(4,125 Views)
 

Hi,

National Instruments recently announced version 3.0 of the NI LabVIEW Simulation Interface Toolkit. National Instruments’ CAN hardware as well as CAN channels and messages are now supported directly, which should make tasks like this much simpler.

-B2k

 
0 Kudos
Message 4 of 4
(3,984 Views)