Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic CAN Bus Example

Hi everyone,

I have questions about CAN Bus. It is the only communication bus that I did not use in LabVIEW. So I do not know fundamentals of CAN in LabVIEW.

 

To understand similarity, I will attach a VI that I wrote in LabVIEW to communicate with a device without any NI Hardwares with RS232 cable. This VI works. There is no problem.

 

But as I said, I have no experience with CAN Bus. I created a CAN VI which is similar to the RS232 VI. But in RS232 VI, the data packet came in hex (string) format since I used VISA functions.

 

In CAN VI, I have specification of device. I know numeric representations of variables. But I guess I can not use VISA functions. So the hex packet will come in string or not??

 

Please just make a basic CAN example that is similar to the RS232 VI I attached. In this way, I will be able to imagine what happen.

 

Thanks

Download All
0 Kudos
Message 1 of 12
(17,881 Views)

The can bus is not supported under visa.

Sorry so you need to check the driver for your can bus interface.

Which can bus interface do you have in your pc?

greetings from the Netherlands
0 Kudos
Message 2 of 12
(17,852 Views)

I download NI CAN Interface tool if you asked this.

 

Sir, Normally I use lots of products of NI, but right now we do not have CAN module and enough time. In this project, there are only third party device and CAN-USB converter. I have to monitor the CAN datas in LabVIEW.

 

Since I did not use CAN Bus in LabVIEW before this time, I have no idea what I will do. As I said, I have specification of CAN frames. I prepared required algorithms. But I do not know the communication part.

 

Can you send me a basic example to read CAN message from a standard CAN frame with Arb. ID, Data Length, Data etc.... ??

0 Kudos
Message 3 of 12
(17,847 Views)

Hi

i have a project which is:::: simulation of dashbord on labview  i prepared the interface but i have problem in data acquisition from CAN bus ( Controller Area Network)  because i dont have a hardware device to manipulate just simulation 

how can i do it ??? 

thanks 

0 Kudos
Message 4 of 12
(17,543 Views)

The CAN communications bus works at a much differently than most communication schemes.  The bus is typically at 1.5Vdc when not in use.  It uses a dominant and recessive bit scheme plus a number of others.  It is not as simple as RS-232.  You will need to understand how you need to interface with the CAN bus.  Will you simply be getting data?  Do you need to handle the interface?  There are a number of issue you will need to comprehend in dealing with 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 5 of 12
(17,533 Views)

i want to send data  via can bus can any one help me just to have idea  to a dashbord but i dont have a hardware device 

0 Kudos
Message 6 of 12
(17,527 Views)

Unfortunately, the simulation of CAN devices isn't possible. There are example programs already written that are included in the XNET driver, but you won't be able to run them successfully without hardware.

 

Please refer to : https://forums.ni.com/t5/Automotive-and-Embedded-Networks/Is-it-possible-to-simulate-a-XNET-CAN-devi...

Alex
Hardware Engineer
0 Kudos
Message 7 of 12
(17,496 Views)
hi everyone; i have this interface of dashboard i want to simulate it with data from database how can i do this
0 Kudos
Message 8 of 12
(17,442 Views)

This depends on what format the data is in, and what kind of database.  If there is a suitable "Read from" VI for your data, you could drop that in the block diagram, and wire it into your input.  Further clarity on the format of data, kind of database, and where in the code you would drop it may help others provide further insight.

Trevor H.
Technical Support Engineer
National Instruments
0 Kudos
Message 9 of 12
(17,398 Views)

hi 

my data is a CAN frame 

you find here an explication of the frame 

i want to read those byte of the frame separetly and simulate the binary data of data CAN on the interface 

0 Kudos
Message 10 of 12
(17,379 Views)