LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I send a CAN signal without having an actual source of a signal?

Ok. I'll give that a try but I guess I was hoping someone could explain how a frame as displayed on say the CAN basic example can be understood in terms of the example.ncd database file.  ?how would I structure a frame to match up with the message on the database? 

 

In my understanding a database file tells labview what the messages look like so that when a message matching one of the channels is sent, it will know it was that specific message.  Or am I confusing terms?  Is a frame just a bunch of channels?  Sorry for my low level of CAN knowledge.

0 Kudos
Message 11 of 18
(713 Views)

A CAN frame is the useful portions of a raw CAN packet. There are several fields in a CAN packet that you don't need to worry about - they're computed automatically and used for signaling or verifying data integrity. The parts you do care about are the arbitration ID (11 or 29 bits) and the data itself (up to 8 bytes), and occasionally a few other fields. The CAN database simply defines the data that arrives with a specific arbitration ID. For example, you might have a channel that corresponds to the 2nd and 3rd bytes of a packet arriving with an arbitration ID of 17. It is relatively easy to generate packets that match the database format. You can also use the Frame Channel Conversion library. I don't think you even need a CAN device to play with this, but I haven't used it much. If I'm not mistaken, you can feed data into channels and see how they're converted to frames, and vice versa without sending any packets at all.

0 Kudos
Message 12 of 18
(697 Views)

Would I be able to send packets without a CAN device?  Like say having code that generates some randomized packets in accordance to the database?  Or would that be something that can be done with the data being fed into the channels? 

 

Thank you for the help so far.  You have definitely helped me understand CAN signals a little more.

0 Kudos
Message 13 of 18
(692 Views)

@SRamirez wrote:

Would I be able to send packets without a CAN device?  Like say having code that generates some randomized packets in accordance to the database?  Or would that be something that can be done with the data being fed into the channels?


I have no idea what you're asking here. You definitely cannot send anything over a CAN network without a CAN device. However, you can read data formatted as CAN packets from some source other than an actual CAN interface (for example a file, or a program that generates CAN frames). What are you trying to do? You could feed channel data into the Frame Channel Conversion Library and get back CAN frames, or vice versa, but I'm not sure if that helps you.

 

I haven't looked at the actual code for this, but a search on the NI site turned up the the Advanced CAN Frame to Channel Conversion Reference Example; the description says it's a CAN data logger designed to work with the 9853.

0 Kudos
Message 14 of 18
(686 Views)

nathand,

 

Thank you for all the help.  I am currently trying to read in a CAN log file I created from channels I created in NI MAX.  For some reason I am getting error 7 at the open file terminal saying it can't find the file.  I know the path is good.  I don't know what it causing it.  Any experience with this? 

0 Kudos
Message 15 of 18
(671 Views)

Hi Ramirez,

 

maybe you're trying to read a file (creating using MAX on PC) that isn't available on your cRIO target?

 

What's the path of the file, where's the read function?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 18
(669 Views)

I have the file on the c drive so its simply c:\logfile.ncl.  I have verified that it is there.  In the different vi I am opening a .ncd file in the same location and it doesn't seem to have a problem with it.

0 Kudos
Message 17 of 18
(667 Views)

I moved it to the cRIO and it worked.  I keep forgetting that the cRIO acts like a computer itself.  Thank you for the help.

0 Kudos
Message 18 of 18
(661 Views)