Hi Shibham,
I understand that you want to transmit raw CAN data from the MathWorks virtual CAN bus to a Kvaser virtual CAN bus and observe the output in CAN Explorer.
Here's a general outline of the process:
- Ensure you have the Vehicle Network Toolbox installed in MATLAB, which allows you to use CAN communication.
- Create a virtual CAN channel in MATLAB that corresponds to the MathWorks virtual CAN bus.
canCh = canChannel('MathWorks', 'Virtual 1', 'BusSpeed', 500000);
- Create CAN message(s) with the raw data you want to transmit.
msg = canMessage(100, false, 2);
- Install the Kvaser drivers and make sure the Kvaser virtual CAN bus is properly configured on your system. You may need to use the Kvaser Hardware Setup tool to create a virtual CAN channel.
- You might need to change the channel in MATLAB to match the Kvaser virtual CAN channel. If Kvaser's virtual channel appears as a device in MATLAB, you can directly use it:
canCh = canChannel('Kvaser', 'YourVirtualChannelName', 'BusSpeed', 500000);
- Open CAN Explorer and connect it to the Kvaser virtual CAN bus. Configure the CAN Explorer to listen to the correct CAN bus speed and channel. Once connected, you should be able to see the messages transmitted from MATLAB.
Hope this helps.