Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Customized FPGA VI with CAN Interface

Solved!
Go to solution

Hallo,

 

ich habe ein Simulink Modell mit einer CAN Schnittstelle, habe dieses Modell in eine .OUT Datei kompiliert, und benutze SIT 2009 auf RT cRIO 9014 (mit dem NI CAN Modul 9853 ) um die Signale vom PC Host an das Modell einzuspeisen.

 

Durch FPGA Mappings und ein entsprechendes FPGA VI will ich Daten vom/im Modell senden/empfangen.

 

Ein entsprechendes VI heißt in dem Fall ein VI das folgende Kriterien erfüllt:

 

- hat die entsprechende Timing-Architektur um die Verbindung mit SIT zu gewährleisten (wie das SIT IO cRIO VI unter LabVIEW XXXX\vi.lib\addons\Simulation Interface\_IOTypes\Plugins\NI-FPGA\FPGA IO Source     das mit SIT geliefert wird).

- beinhaltet die Datenaufbereitung/Datenumwandlung die von FIXpoint Werten die vom Modell kommen, einen gültigen CAN Frame daraus machen.

 

 

 

Nun habe ich eigentlich nicht viel zum Senden Empfangen; jeweils nur 1 Message (64 bits), deswegen bietet sich die Möglichkeit an, ein relativ einfaches Umwandlungscode zu schreiben und zwar direkt im FPGA VI (nicht auf RT da es in dem Fall ungünstig ist).

 

Bei der Implementierung dieses Codes habe ich Probleme.

 

Hat man das Problem schonmal gehabt ?

 

Das wäre echt sehr nett  !!

 

Viele Grüße,

Meddeb.

0 Kudos
Message 1 of 6
(4,400 Views)

Hi Meddeb,

 

I modified the original SIT FPGA Project and inserted a CAN interface including conversion from FXP to INT (see attachment)

 

Make sure you read Creating a Custom FPGA Bitfile (Simulation Interface Toolkit) in the LabVIEW help.

Copy the resulting bitfile to the labview\vi.lib\addons\Simulation Interface\_IOTypes\NI FPGA\FPGA IO VIs\FPGA Bitfiles\FPGA Bitfiles,relative to the project file directory. By default, the bitfile name is name of project_name of FPGA VI .lvbit. directory. The compiler places the bitfile in a subdirectory, FPGA Bitfiles,relative to the project file directory. By default, the bitfile name is name of project_name of FPGA VI .lvbit.

 For further information how to create the CAN frames, read NI 9853 and 9852 with CompactRIO FAQ.

Hope this helps to finish your project.

 

Regards

 

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
0 Kudos
Message 2 of 6
(4,380 Views)

Hallo AndreasS,

 

thank you very much for your quick reply !

Today I was not on the office, so that I couldn't try your Code on the cRIO/FPGA, but it seems to be what I am searching.

 

Thank you again, I will inform you soon how your Code (efficiently) solves my Problem.

 

Regards,

Meddeb 

Message Edited by Jarod3391 on 10-09-2009 05:03 PM
0 Kudos
Message 3 of 6
(4,374 Views)

Hello AndreasS,

 

sorry !!  Your project contains no VIs.

 

Please join the FPGA VI and thank you in advance !

 

 

 

Regards

------ 

Mehdi

0 Kudos
Message 4 of 6
(4,360 Views)
Solution
Accepted by Jarod3391

Sorry, I could not convert the FPGA VI to an earlier version, so here is the LV 2009 Version.

 

Regards

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
0 Kudos
Message 5 of 6
(4,352 Views)

Hi AndreasS,

 

sorry for the late reply !

I work already with LV 2009, sothat it was no problem to open the VI :smileywink:

 

Thank you very much for your help!

I used your VI as template and developped many VIs from it. I am now testing the CAN Interface and try to improve the number of messages sent with different IDs.

 

 

Thank you again !

 

Best Regards.

Mehdi.

0 Kudos
Message 6 of 6
(4,318 Views)