LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

List NI-CAN HW channels

Solved!
Go to solution

A simple (probably) question that I cannot solve.

 

LabVIEW program accesses equipment via multiple CAN channels. When the program is started, operator must select one or more channels.

 

How can the program obtain list of available CAN channels? The list differs between different stations; thus it must be obtained "on the fly".

 

Thank you

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 1 of 6
(2,655 Views)

Hi Y,

 

NI-CAN can handle DBC files (CAN databases, other formats supported as well). So you can write a program to load a DBC file, parse it's content and show a "channel" (aka messages and signals) selection to the user!

Best regards,
GerdW


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

Thank you  for the answer. Unfortunately, I do not know much about DBC files and cannot find any in the computer. Where are they located? Is there any doc describing structure of these files?

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 3 of 6
(2,612 Views)

The DBC files are generated by the company that creates the equipment software to which you want to connect with CAN.  It will look something like this:

; Database 123-4567.db
; 

VERSION 103 COMMENT ""

DEFAULT MOTOROLA

MAP 1 "my_canape.map"
MAP 2 "your_canape.map"


GROUP 'TEST' : ""  {
   GROUP 'SYSTEM' : "" 
}
FORMULA 1 0 Boolean "" "" "%7.3" VTAB 0 'FALSE' 1 'TRUE' DEFAULT ""

SEGMENT 'ADC_Err' 0x1:0xAE730
SEGMENT 'Junction.Temp' 0x1:0xAE734

['SYSTEM']
VARIABLE 0x0 'ADC_Err' 'ram_INT_P1' : 730 "" UINT(32) "" 1 0 4294967295 (0 255) PREC 3 MEASUREMENT WEAK_LIMITS 0 4294967295
VARIABLE 0x0 'Junction.Temp' 'ram_INT_P1' : 734 "" FLOAT "" 0 -3.4e+038 3.4e+038 (0 255) MEASUREMENT WEAK_LIMITS -3.4e+038 3.4e+038

It is generated by the software group based upon where certain variables will be found in memory based on the software build that is loaded in the equipment to which you are trying to connect through CAN.

 

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 4 of 6
(2,608 Views)
Solution
Accepted by topic author _Y_

Unless I'm mistaken OP is actually asking about listing enumerated hardware on the start of the software.  Not CAN Channels in regards to frames, signals, or databases

 

I think the code I posted here does what you want (I had a similar question years ago)

 

https://forums.ni.com/t5/LabVIEW/Get-CAN-Bus-Ports/m-p/3350267#M984615

Message 5 of 6
(2,602 Views)

Thank you , this is exactly what do I need.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 6 of 6
(2,588 Views)