Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA SIT VI disturb Applikation Functionality !

Solved!
Go to solution

Dear Sir/Madam,

 

I have a question concerning FPGA combined with the Simulation Interface Toolkit and I will be glad if you could give me advice !

 

I have a HiL Applikation that's based on the following components:

- Host VI on Windows PC.

- Driver VI on VxWorks RealTime System on CompactRIO 9014.

- FPGA VI that contains 2 CAN I/O Nodes which I use to exchange CAN Frames with an external CAN Network for controlling a machine. The FPGA-VI-controls that represent the different channels of the CAN Messages get their signals through FPGA Mappings that I defined with the SIT Connection Manager.

 

My Problem is how to get the best timing for the FPGA VI to synchronize it with the driver VI. The default method that I get from the template is based on interrupts. Although my FPGA Target 9104 supports Interrupts, when I launch the Application and after deploying all the VIs on the cRIO Target, the simulation stops and I get an error: (see attached screenshot).

 

I wonder why the Application couldn't be started when connected with an external CAN Network, because when I tested it with a loop cable (I connected CAN 0 with CAN 1 from the NI 9853 CAN Modul with a CAN cable), it worked without problems.

 

So I will be grateful if you could explain me how can I modify the FPGA VI or the Driver VI to get them work together !

 

I attached also my FPGA VI.

 

Thank you in advance !!

 

--

Yours sincerely,
Mehdi Meddeb

Details zur Software:  LabVIEW FPGA  version 2009
NI Hardware :  RIO (cRIO, R Series, FlexRIO, sbRIO) device CRIO-9014, NI CAN 9853
Driver Version :  NI RIO 3.2
Betriebssystem:  Windows XP

Download All
0 Kudos
Message 1 of 4
(4,404 Views)

Hi Mehd,

 

I think I found your problem:

 

The default  input and output timeout for the CAN module is 10000 ms hence 10 seconds. This means your CAN read operation takes up to 10 s if there is no frame received on the CAN bus.

 

 So you either change the timeout for your modules in advanced module settings in project explorer (check the error cluster, no error only if a real CAN frame was received, in timeout case: error) or you decouple CAN an SIT loop (see attached VI)

 

 can_advanced.png

 

Hope this solves your problem!

 

Regards,

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
Message 2 of 4
(4,363 Views)
Solution
Accepted by topic author Jarod3391

Hello Andreas,

 

thanks a lot for your reply !!!

The problem was exactly what you explained ! I wonder why the default value of the timeout is so big !?!

 

Fortunately I found the solution before one week and since the application works all right !

 

A great thank again and I look forward to hearing from you soon !


 

 

 


0 Kudos
Message 3 of 4
(4,338 Views)

Hi Andreas,

 

 

since my last post my application has run properly but now I have the following problem:

 - I want to send negative channel data and I don't find the way to do it.

 

I transformed the unsigned controls (Inputs) to normal integer controls and tried to send negative data. On the receiver side (PC with vector CAN card) I got strange frames (for instance 32768 for 16 Bit negative channel data regardless of how big they were).

 

It's clear that what I've done is not the right way to announce the send process of negative data. I think the solution is so easy that I overlook her.

 

What do you suggest in this case?

 

Thank you in advance ! 

 

 

------

Best Regards,

Mehdi 

0 Kudos
Message 4 of 4
(4,086 Views)