LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can engine

Hello, I am trying to implemate a comunication with CAN using the NI 9853 with a CRIO and I am using this example, as a guide:
http://www.ni.com/example/31162/en/
But I need more info to really understand how it works, because there are several things I dont get from the example, like the input and output channels names, I dont know what I have to put in there, because I only want to read and I only know the IDS of the incoming messages that are a number of 11 bit (because I want to comunicate using CAN 2.0 A), so I dont know, if I put a hexadecimal number corresponding to the ID in the input Channel name it will work or not.
If you have any example or documentation for a simple way to implement this kind of comunication please post it 🙂

 

Greetings

0 Kudos
Message 1 of 8
(3,437 Views)

Hi Reta,

 

as can be seen be the first picture on the linked page you need to supply a "CAN database file". That database contains the message and signal names of your CAN messages. By using such a database you define IDs and bit positions/lengths for all relevant signals you need to transfer...

Best regards,
GerdW


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

Thank you, but how do I create a CAN database file? For example I attached a image of the structure of the messages I receive, how will be the database file for this case?

0 Kudos
Message 3 of 8
(3,100 Views)

I'm using the CANdb++ Editor from Vector (www.vector.com) to create dbc-files...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(3,093 Views)

thank you!, Do you have an example of a database .dbc?

0 Kudos
Message 5 of 8
(3,081 Views)

I don't want to send you down another path if you are making progress, but an alternative method is to read the data on the bus as Frame data not Signal/Channel.  This way you get the raw data with the ArbID and Payload.  You then need to do the work to understand what was read.  A CAN database is used to help read and scale the CAN data for you but in some cases you don't really care and just want to see raw data and in that case you don't need a database.

Message 6 of 8
(3,048 Views)

I have another question about how to use the database, because the module "host conversion init" need the "input channels", here I put the name of the messages that I defined on the CANdb++, or I need to put the name of the signals that constitute the messages, that I defined. :S

0 Kudos
Message 7 of 8
(2,996 Views)

I found an example of a .dbc file, is included in the next example:
http://www.ni.com/example/30826/en/
its name is demobox.dbc

is suppose to be the same as the file used in the first example referenced:
http://www.ni.com/example/31162/en/
But the thing that I dont get is, why does the input channels are as Tx messages, I thought it must be as Rx messages, also, the output of the module "host conversion read" is an array of doubles, even though the referenced channels are of lower size, like 16 or 8 bits in some cases, I my case I need to treat this outputs of 8 bits as binary, but I cant because the output is in double and the only solution I think of is to set a signal name, to every bit that I need to treat.

0 Kudos
Message 8 of 8
(2,971 Views)