VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

NI CAN custom model

Hi !

 

I have another question... I need to do specific CAN operation for example have a specific flag, or calculate a checksum on a frame .... I know the solution will be to create a custom device with these function. But if i create a custom device to handle CAN , i will also have to re create the function to import dbc, configure ports ... 

 

My question is : is it possible to make some modification in the CAN without having to re developp all CAN  functions ?? 

0 Kudos
Message 1 of 7
(8,096 Views)

Hi.

 

The source code is compiled into the executables on the host and on the RT target.

There is a way to relink to the import DBC file code from your custom device, but there is no way to change the CAN transmit code in the executable.

 

Do you use NI-XNET devices at all?

If so, there is an open source implementation available:

http://zone.ni.com/devzone/cda/epd/p/id/6298

 

Please let me know if this works for you.

 

 

Thanks,

Tom

 

Message 2 of 7
(8,094 Views)

Hi ThSa,

 

Well, I tryed to use the NI-XNET custom device, but i have some problems:

 

1) When I add the custom device, i can choose, the interface type, the interface, the XNet Database... In the combo i have "nixnet_example", and it's impossible to change this value. When i select "browse for database file..." nothing happens.

 

2 ) After tha, when the custom control is inserted, a popup appears : "Error -1074384541 : you used an empty name for the XNET Database." This message appear each time i click on the CAN node.

 

3) Finally, It's impossible to delete this custom device. When i click on the delete button (on the top left) nothing happens. I have to quit the project without saving the modifications.

 

Any idea ...? 

 

0 Kudos
Message 3 of 7
(8,073 Views)

Hello KaBooOoom,

 

What do you mean by "nothing happens" when you click browse for database?  You should have a popup window that lets you browse your hard drive for a database file.

 

When you browse for a database file, you select a database, and click ok.  The IO control is not populated with your new database.  You have to click on the IO control (the ring with the database names) and select your newly added database.

 

You can also open the NI-XNET database editor (Start -> All Programs -> National Instruments -> NI-XNET) and open your database from there.  You can also create a new database, or edit the existing one.  That should also add an alias that will be displayed in the ring control of the custom device.

 

Let me know if any of this helps.  Have a great day. 

O. Proulx
National Instruments
www.ni.com/support
Message 4 of 7
(8,069 Views)

Hi !

 

"Nothing happens" means, that no popup appears. I thought I could choose a .dbc present on my drive from here...

 

Finally i used the NI-XNET database ditor, and i imported the dbc. After that i created the NI XNET custom device, and now, i can see my database in the ring control.

 

I think the points 2 and 3 arised because i wasn't able to choose a database... But it still weird... 

0 Kudos
Message 5 of 7
(8,064 Views)

Hi

 

Ok, it was my fault, i had an old verison of the NI XNET driver installed ... (beta 2 ) . I downloaded the last version, and now it seems to work...

0 Kudos
Message 6 of 7
(8,061 Views)
Great to hear you are up and running.  Let me know if you have any feedback on the custom device. 
O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 7 of 7
(8,057 Views)