LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulate CAN-Bus Communication

Hi there,

 

I need to create a Sub-VI, which can receive messages on a CAN-Bus-Device (NI-9861). However, I do not have the device myself, so I need to simulate that.

 

I do know the content of the two (2) messages, that will be send on the CAN Bus, which is:

ID 1100:   Byte 0-3 DINT, Byte 4-5 INT, Byte 6-7 UINT  (8 Bytes total)
ID 1105:   Byte 0-1 UINT, Byte 2-3 UINT, Byte 4-5 UINT (6 Bytes total)

 

Can I send those messages over my virtual CAN-Bus-Port (which is CAN256 and CAN 257, as I understand) via NI-Max?

How can I receive them once I sent them?

Would I need a VI to both send AND receive my messages?

 

Thanks you for your help

Martin

0 Kudos
Message 1 of 3
(2,252 Views)

Hi mw,

 

Can I send those messages over my virtual CAN-Bus-Port (which is CAN256 and CAN 257, as I understand) via NI-Max?

You can send those messages from another VI. Create a simple VI to send those messages…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,243 Views)

Thank you @GerdW for the clarification.

 

I just found the examples "CAN Receive" and "Transmit Receive same Port" via the LabView Help Example Finder.

 

I think I can go from that code and modify this, so I can send and receive my exact messages with my timing over the virtual ports. After that, i should be able to modify the "CAN Receive" for my needs.

0 Kudos
Message 3 of 3
(2,228 Views)