From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

X-CAN sample project problem

Hey guys,

 

I´m getting started with the myRIO-1900 and try to connect it with my car via X-CAN module with OBD-II BD9 cable to collect and record data from my car.

 

I've installed Labview 2014, X-CAN, realtime module in my computer without any problem.

 

When I connected myRIO 1900 and X-CAN module with my Mercedes, launched "X-CAN for myRIO" under "sample project", it worked successfully and I can read data from Labview.

 

Question 1: What do all the data read mean in the labview, eg. what does identifier means and what does payload means? At first I thought they might be PID codes, but after browsing all the info online, I felt the data are not PID codes because they should start with P01 or P02. Is there a manual for me to review and learn?

 

Question 2: Do you guys know how can I record all the data that read from my vehicle and export them to Excel file? I tried to add "File I/O" and "Measure to write" followed by the instructio online, but there was not excel file generated after the run. Any suggestions?

 

Here is a snapshot of the project result. Appreciate for the help.

labview data issue.jpg

X-CAN project.jpg

X-CAN project 2.jpg

0 Kudos
Message 1 of 6
(3,910 Views)

There is TONS of documentation on CAN buses.  From various hardware and software implementations and a bunch of other variations that can make working with it difficult.  

 

On the surface everything is easy, you just read and write frames, as described here

 

http://en.wikipedia.org/wiki/CAN_bus

 

Frames are just raw data that you can then do things with.  A frame consistes of an ID which identifies the message and also does things like sets priority of the message.  Then the payload is 0-8 bytes (excluding CAN-FD).  These 0-8 bytes are the usable parts of the message.  Protocols have been written to support multi frames, and request reply, among several other features not supported in the hardware.  

 

Basically you have a lot of reading to do.  Find all the documentation you can on CAN and how it works knowing that it starts at the frame level which is what you get.  You might even get something out of the first few slides of a recent presentation I did on CAN and XNET.

 

https://decibel.ni.com/content/docs/DOC-41749

 

As for recording the data.  The most common way is to format it into a 2D array of string, and then use the write measurements to file, or write spreadsheet to create a CSV file that Excel can open.  There are other options that are usually more messy, but can be done.

 

EDIT:  Oh and you might get better support from CAN related questions over on the Automotive subforum.

0 Kudos
Message 2 of 6
(3,879 Views)

One more mistake often related to RIO hardware:

when you create a file on your RIO system it will be stored in the RIO system - but not in your PC/laptop!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(3,871 Views)

Can you please share the .vi of sample given in software. I get a "error 1055" when I try to open the example. tried on LabVIEW 2015(supplied with the myRIO Bundle) and also LabVIEW 2017. Still get the same issue.

Please help


@lichlich1 wrote:

Hey guys,

 

I´m getting started with the myRIO-1900 and try to connect it with my car via X-CAN module with OBD-II BD9 cable to collect and record data from my car.

 

I've installed Labview 2014, X-CAN, realtime module in my computer without any problem.

 

When I connected myRIO 1900 and X-CAN module with my Mercedes, launched "X-CAN for myRIO" under "sample project", it worked successfully and I can read data from Labview.

 

Question 1: What do all the data read mean in the labview, eg. what does identifier means and what does payload means? At first I thought they might be PID codes, but after browsing all the info online, I felt the data are not PID codes because they should start with P01 or P02. Is there a manual for me to review and learn?

 

Question 2: Do you guys know how can I record all the data that read from my vehicle and export them to Excel file? I tried to add "File I/O" and "Measure to write" followed by the instructio online, but there was not excel file generated after the run. Any suggestions?

 

Here is a snapshot of the project result. Appreciate for the help.

labview data issue.jpg

X-CAN project.jpg

X-CAN project 2.jpg


 

0 Kudos
Message 4 of 6
(2,975 Views)

Hi Kaushalm,

 

This post is 3 years old. Try making a new post with the following information:

  • What VI you are trying to run (I recommend including this as an attachment)
  • What your physical setup is. How are you wiring your signals?
  • Where in the code the error occurs. You can find this with Execution Highlighting.

Regarding error 1055, that's a generic one where LabVIEW doesn't understand the reference you're using. Try disabling any startup applications. Check out this KB for some insight.

 

BDog

0 Kudos
Message 5 of 6
(2,964 Views)

hi,

i have the same problem!

have you found a solution ?

thank you

0 Kudos
Message 6 of 6
(2,796 Views)