Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait for IRQ (FPGA and RT)

Hello,
 
I've a RT application running on a cRIO-9014 (LabVIEW RT 8.5 and cRIO 2.3.1).
 
The RT application has two loops embedded into two subVIs.  One with "Above normal" and one with "HighPriority".  Some code  also runs on the FPGA to manage CAN communications and generates an IRQ when a valid answer is received from an instrument.
 
The subVI with "Above Normal" uses the "Wait for IRQ" FPGA node.  NI Support confirmed me that this node should not use CPU and should put my VI to sleep, so other VIs can run.  However it is not the case.  While my "Above Normal" subVI is waiting for the IRQ, the high priority subVI doesn't preempt it.
 
Using the Execution trace toolkit, I've put one custome flag before and one after the invoke node.  The waiting time is around 100 ms.  In the trace session, I clearly see that my "High priority" subVI doesn't execute between the flags.  However, the VxWorks Null Thread which is a has a background priority runs all the waiting time.
 
I'm also expecting another curious behavior.  If I put my "High Priority" subVIs to "Time-critical", my other VIs never preempt it even if the LabVIEW RT Wait function is used inside the Time-Critical subVI. (I need a 2ms delay but tried up to 100ms)
 
Has someone seen these behaviors?  Are they known bugs ?  I most interested with the IRQ problem.
 
Regards,
 
Patrick Lessnick, P.Eng, CLD, CPI
Averna Technologies
 
 
0 Kudos
Message 1 of 3
(5,666 Views)

Hello,

I've figured out that the problem was with the WAIT ON IRQ node which was used in my two subVIs (on different IRQ lines).  I put my two subVIs in different execution systems and it start working correclty.  It is funny that 2 is too  many...

 

From the invoke node help...

"The Wait on IRQ method consumes threads. If you use too many calls to the Wait on IRQ method, other code in the application might stop executing until an interrupt occurs. If you notice unexpected execution behavior, try reducing the number of calls or put the Wait on IRQ methods in subVIs in different execution systems. Use the Execution Properties page to specify the execution system."

-Patrick

Message 2 of 3
(5,643 Views)
Patrick:

Thank you very much for sharing the solution with us. Please post again if you have any further questions.
Regards,

Rudi N.
0 Kudos
Message 3 of 3
(5,516 Views)