From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Data frames in Channel API

Hi, in my project we need to send messages(PGNs) of J1939 format onto the microcontroller device and receive the response from the same. I have tested the microcontroller with the NI CAN software using MAX and it is working fine. Now I have to develop a LabVIEW application to send and receive the commands. I have used the "CAN write.vi" (Channel API) to send the CAN message. By using the "CAN Create message.vi" I am able to configure the PORT, Arbitration ID, Data length (8 bytes in my case) etc. But I dont find the field where I can fill in my data (8 bytes) in hex format.  Presently I have put my data in the "Single-chan Signle-samp dbl" input field of the "CAN Write.vi". Please let me know where I need to fill in the data values.
 
I have attached the vi I have developed.
 
           
 
 
 
 
 
Regards,
Krishna.   
0 Kudos
Message 1 of 3
(3,607 Views)

Hi Kittamma,

You wrote, that it worked with the Max and now you are using the create channel function. Is there a reason not to take the channel database? To have control about every databyte, the only solution is to create or have one channel for every databyte and to write all channels together in one task.  The data has to be wired allways to the write VI.

But keep in mind, if you have allready a databasefile or configuration in MAX, you can take the Init or InitStart VI and this VI takes the configuration automatically from MAX or your file.

DirkW

0 Kudos
Message 2 of 3
(3,594 Views)

Hi Dirk,

The reason why I'm not considering this option is that for some validation or test purpose, this is a very good option (Using the CAN db or MAX config). But when using the Executable or installer in some other PC, I need to have these databases or MAX software in that PC also.

Because of this, I'm using the Programmatic configuration by using Frame API VIs. Now my program is working fine......

Thanks,

Krishna

 

 

0 Kudos
Message 3 of 3
(3,577 Views)