LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ProcessTCPEvents & priority inheritance

Hello,

 

I'm working with CVI RT on a dual core PXI. One CPU is dealing with TCP (server) and the other one is running a 1kHz custom regulator.

When a windows client connect on the PXI, the server receive the configuration and the start command. During regulation, mean values are sent every 100ms. Everything is fine and both CPU are loaded between 2 and 3 %.

After 5 to 15 s both CPU are 100% loaded during 1 to 2 s before going back to the previous state.

By using the real time execution trace toolkit I identified the problem around the function ProcessSystemEvents running on CPU 0. The client does NOT send any request and there is nothing to process comming from TCP (except server mean values emission every 100ms). The server thread (THREAD_PRIORITY_NORMAL, CPU 0) inherits the priority of the regulator thread (THREAD_PRIORITY_HIGHEST, CPU 1). Because there is no activity on TCP from client to server I assume that the only function running on the server Thread is ProcessSystemEvents.

So why ProcessSystemEvents never end up ?

I set name to identify Threads and RTETT display them correctly, I did the same for lock but I cannot see anything. Is there a way to display them ?

 

Best regards

 

JFM

0 Kudos
Message 1 of 3
(3,356 Views)

Additionnal informations:

 

I tested a new version of the Real-Time controller program without any CVI TCP function. Everything is low level socket based. I also removed all critical sections but the problem is still there.

 

The switch occurs now between my regulator thread on CPU 1 and the server loop on CPU 0 (still no activity on TCP...). printf is executed very often during the switching period but I'm not using printf in my software !

 

I'm not sure to be able to relies on the trace toolkit because:

* the program is running during ~20s but I sometimes get 20ms in the trace toolkit (sometime 5s but never the expected duration)

* I set name for thread and lock (I kept the creation/destruction and just remove acquire and release) and a lock name show up in the thread view...

 

Any ideas ?

Is there new versions of software I can use to debug that problem ? (CVI 9.1.1 > 450 & RTETT 2.0.3).

 

JFM

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

I launch a identical version on windows XP (on the same PXI) and everything is fine. This is also OK @ 10KHz (1kHz for RT).

Is Windows more reliable than Pharlap ?

 

JFM

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