From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem:100 % cpu usage with tcp server dll

Hello,

 I am trying to write a dll with labwindows/cvi that allows me to create a TCP Server. This dll is integrated in labview.I created this Dll with example provides by Labwindows/cvi(rtserver.dll).

Description of my problem: when i execute this dll in a "While Loop" in labview,the TCp server wait a connection and 100% cpu usage occurs. However when a client is connect to the server,the CPU is normaly used because the program stop when he meets the timeout of the tcpread() function. I would like to know how i could limit CPU usage  when the server is awaiting a client in the labview "While loop".
I know I could use a DELAY() to limit Cpu usage ,but I would like to know if there are any others solutions.

thank you.

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

i dont know your exact application, but i generally use Q to transfer data to TCP loop in my prgram it helps me in two ways.

1. it automatically restricts the iteration when ther is no data (Less CPU Usage, Less Unnecessary Trafic)

2. Q can eliminate problems arising due to non synchronization of loop

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 2 of 2
(2,286 Views)