LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp/ip communication

Hello,

 

I am working with an application based on the tcp/ip communication subvi´s. The problem is, when the server is waiting for any connected unit, the computer is using the 100% of its resources. I think this is not a good option, even more for my case, in which I have more than 15 listeners working at the same time. That makes the computer to work really slow.

 

Does anybody know if there is any way to do a "passive listening", waiting for any event (visiting the port every some time) to start the communication? Right now, the computer is continiously listening in 20 different ports, which spends a lot of the computer resources.

 

Your suggestions are highly appreciate. 

 

Thanks in advance.

 

jm

0 Kudos
Message 1 of 7
(2,747 Views)

Hi jmhf,

can you show your vi? I never saw such a behaviour. Are you sure that all of your listeners are started without an error? Maybe one of your ports is already in use, then it could be that you run your loop as fast as possible, because your function will not be executed.

 

Mike

Message Edited by MikeS81 on 06-18-2009 09:48 PM
0 Kudos
Message 2 of 7
(2,733 Views)

Hi again,

 

I do not have the code here. Tomorrow morning, from the office, I will post it.

 

Anyway, the problem comes from the "Listen.vi" subvi, which keep executing until it gets any connection. This execution spends a 100% of the computer resources. This subvi has a timeout input, which has a "-1" default value. This means no timeout at all, that is to say, an infinite valu, continuously listening. Is there any way just to listen when any computer connects?

 

jm

0 Kudos
Message 3 of 7
(2,728 Views)

Here you have a part of the code. I havejust one connection working, one port listening, but the complete computer resources are used (100%) while executing TCPIP listen.vi.

 

Thanks in advance

 

jm

0 Kudos
Message 4 of 7
(2,700 Views)

Hi jmhf,

i can't see this behaviour with your vi. Did you check if you get an error? Do you really have the 100% cpu usage if the "TCP Listen.vi" waits for a connection?

 

Mike

0 Kudos
Message 5 of 7
(2,690 Views)

I too am not seeing the problem you described.  Is it possible you have a firewall or other security software running on your machine that's causing some sort of interference when you try to open a port for listening?

 

Also, unrelated, there's absolutely no reason to be using local variables for your timeouts.  Just wire the block diagram terminal directly.

0 Kudos
Message 6 of 7
(2,686 Views)

Hi again,

 

all of you were right, this works properly. The problem was not this part of the sofware, but another while loop running at the same time. thanks to everybody for your help, and sorry for make you to lose your time.

 

jm

0 Kudos
Message 7 of 7
(2,640 Views)