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:
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 🙂
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...
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?
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.
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
I found an example of a .dbc file, is included in the next example:
its name is demobox.dbc
is suppose to be the same as the file used in the first example referenced:
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.