LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ServerTCPRead() Delay

Solved!
Go to solution

Good Day, Sir

I am running a application in a while loop, my program acts as a TCP server, and receives Client data via ServerTCPRead() after getting a hardware trigger(SOT).

 

it is weird that when on line test the time elapsed~80ms in the while loop, but offline test without in while loop, the  time elapsed~5ms

 

while()

{//while loop

   If(sot==1)

   {//if

      T1=timer();

      dataSize = ServerTCPRead (g_hconversation, receiveBuf, dataSize, 1000);

      T2=timer();

   }//if

}//while loop

 

T2-T1 ~80ms(too long)

 

I have surf the similar question like:

 

https://forums.ni.com/t5/LabWindows-CVI/ServerTCPRead-always-takes-500ms-to-read-with-timeout-set-to...

 

could any one help me reduce the time elapsed to~5ms in a while loop?

thanks

 

 

0 Kudos
Message 1 of 2
(1,518 Views)
Solution
Accepted by topic author 2axujgxr

Hello,

If You are making stand alone application, then when compiling it use OpenMP .

Especially this part might solve Your problem.

Regards.

0 Kudos
Message 2 of 2
(1,409 Views)