TCP Listen VI

I'm experimenting with the network queue example found in C:\Program Files\National Instruments\LabVIEW 2009\examples\general\queue.llb\Network Queue Example.  In the server, a TCP Open Connection occurs at localhost:NetQueueData.  The server also does a TCP Listen at NetQueueEnd:8155.  The Client does (more or less) the oppposite.  It opens a connection to localhost:NetQueueEnd and listens on NetQueueData:8154.  The problem I have is the comment found in the client....
"The listener must start first in the Server before this VI opens the connection. This delay makes sure this happens."
I have a Server (of sorts) that is always running.  The clients, however, are going to come and go.  What I mean is that I plan to kick off the server (from TestStand) in its own thread.  Then teststand will call test VIs one by one.  Each (when it's running) will be the client.  I would like each client to (as described above) connect to localhost:NetQueueEnd and listen on NetQueueData:8154.  It will send a command to the server, the server (listening on 8155) performs the client command and replies to the client who receives on 8154.  The client determines pass/fail and tells TestStand.  Then TS calls the next (client) and we repeat the above sequence.
Is there any chicken/egg problems with trying to establish a listener at the client AFTER the server has already established the TCP connection?  Any other concerns with what I'm proposing?

I must admit I'm a little confused by your question, but the words Network Queue reminded me that I had worked on an example library of VIs that operate almost exactly like the queue functions themselves, but that can send and receive data over the network.
You might give these a try (saved in LV2009). You simply host your queue using the Server polymorphic functions, and use the Client polymorphic functions to access them across the network. There is built-in support for three datatypes: string, variant, and object (LVOOP).
You might give these a try. It's about as simple as using named queues (hopefully ).
Message Edited by Jarrod S. on 11-05-2009 10:47 PM
Jarrod S.
National Instruments
Attachments:
Network Queue.zip ‏422 KB

Similar Messages

  • TCP Listen vi does not work in Labview RT 7.0

    I'm trying to use a TCP Listener to accept connections from another PC on the local network.
    When running the program with Labview 7.0 all works fine and I'm able to receive IP packets from the remote PC.
    However, when I run it in Labview RT 7.0, the TCP listener does not listen on the specified port.
    Another issue - after running the program in Labview 7.0, and then trying to run it again with Labview RT 7.0, if the specified port
    is the same, I get error 60: "The specified network address is currently in use."
    I'd appreciate your help,
    Alik

    Hi alikm,
    I am a little confused on what your set up is. When you say that you are running LabVIEW Real-Time, do you mean that you are running the program on a Real-Time target? How are you establishing that the project you are setting up is a Real-Time project?
    Also, if you are trying to access one port at the same time using two systems, you will get an error that you are not able to do this, since you can only write to a single port once at a time.
    Regards,
    Stephen S. 
    National Instruments
    Applications Engineering

  • Network Hotsync - Error Starting TCP Listen?

    I've had no trouble using Network Hotsync in the past. Now whn I try to enable it using Hotsync Manager on the PC I get an error message: "Error Starting TCP Listen"
    Everything looks fine in the SETUP dialog....as soon as I try to select "Network" in Hotsync Manager I get the error. I've had no problem with USB syncs.
    Anybody ever seen this error message? ideas?
    Post relates to: Palm TX

    I have the same error message.  Did you ever find a solution?
    Post relates to: Palm TX

  • TCP Listener returned error on accept = AFP blows up. Need help

    Environment: 10.6.7 Server. Xserver. All Mac clients. It's a school. Problem: AFP refusing connections or not loading the Home Directory Symptoms: Library/Logs/AppleFileService/AppleFileServiceError.log blown out with "TCP Listener returned error on accept" happening every second.
    I cannot figure this out. The server has not been updated recently. -checkhostname returns no error. There have been some new iMacs (10.6.8) connected recently. I have read this might be MaxThreads; or corrupt .DS files, but I am really struggling. Please - any clues at all? I can't keep rebooting every day. Any ideas at all please.

    hi pkmusic, we are having the same problem. do you have phone over IP? we are using 5 servers (10.6.7 and 10.6.8) for user home directories. network goes through Siemens IP-Phones. Each server has max. 40 - 50 users but the error occures even if there are only 15 - 20 users connected. have to check the MaxThread-Settings next week ...

  • Error in Create TCP Listener - Linux

    Hi,
    When using the Create TCP Listener function in Linux Red Hat 9.0, I get an error (ill-formet net address). What is strange is that I get this error only when running the VI (built as an executable) as a regular user. When I run it as root, no problem.
    Any idea?
    Thanks,
    Alex

    Hello Alex,
    We've seen this issue before with Linux users (for example
    http://forums.ni.com/ni/board/message?board.id=170&message.id=63457&requireLogin=False),
    it seems as though you'll have to change some permissions in Linux if
    you want to use TCP when not logged in as root.
    Hope it helps-
    Travis M
    LabVIEW R&D
    National Instruments

  • Tcp listen accepts multiple simultaneo​us connection​s even when closed

    LV 6.0.2, win 2k
    I am trying to set up a server that will recieve data from multiple clients. If I set up a TCP listen vi on the server, then I have found that any (or the same) client can open multiple connections on this port and send data to it even though the server has only called the TCP listen VI once and only has a reference for the first connection. The subsequent connections seem to be accumlating in the port buffer and the data can in fact be retrieved with subsequent calls to TCP listen on that port regardless of whether the client has closed the connection long ago and forgotten about the transaction.
    This could perhaps be considered either a feature or a bug. For me it is undesirabl
    e. I would prefer that attempted connections to the server were rejected if the server is not actually actively listening on the port. Otherwise clients can easily flood the port.
    Is there some way to control this behaviour, or perhaps a completely different approach? or is there some way to control the port settings such as buffer size or max number of connections allowed, and a way to clear the buffer without processing all the connections?
    Thanks in advance for any thoughts.

    Thanks for the comments.
    I don't seem to get the same behaviour you describe.
    When you say 'if the server closes the connection after reading the first request, then it will not process the rest of the requests waiting in the queue'. I find that after the server closes the connection (with TCP close connection) then there can still be a huge backlog of connections to the same port (requests) which are still waiting to be processed. Another call to TCP listen retrieves one of the old ones, it doesn't wait around for a legitimately new request from a client.
    Where you say 'When you leave the connection open on the server side, you can receive multiple commands this way, but it also blocks other clients from connecting until the curre
    nt client disconnects'. This is in fact my main difficulty. Even with a connection held open other clients (or the same client) CAN make other connections and send data through that connection. This then backs up if the server is not processing them faster than recieving them.
    I've attached vi's which should demonstrate the issue.
    I couldn't check your vi's. I'm missing the EOC error.vi and one other I think. Ultimately I hope to do something similar with multiple open connections, but still need the server to be able to refuse connections if it wants to. Something I don't seem to be able to do. The connections just keep coming regardless of how the server is set up.
    Thanks again.
    Steve
    Attachments:
    server.vi ‏229 KB
    client.vi ‏28 KB

  • TCP listener?

    Hello,
    Is it possible to create TCP listener instead of HTTP or IIOP one in J2EE? My client application sends only TCP messages and as it is external system I can not change it. How to deal with it in elegant way within J2EE?
    Thank you,
    Ps. I am newbie in J2EE and currently designing new application.

    Just put a multiplexing proxy between the two,
    wrapping your legacy request in an http request
    and feeding back the html response.

  • Error 11 with TCP Listen.vi and named service

    I am using TCP Listen.vi with a named service so my Real-Time application can act as a TCP server without the clients needing to know the specific port.  I am using LabVIEW 8.5.
    I am getting Error 11 from TCP Listen.vi if no client has connected within a certain amount of time.  I have traced the problem down to the TCP Listen Internal List.vi inside Internecine Avoider.vi in TCP Listen.vi.  I think I have found a bug in this vi.
    What is happening is that the Search function of TCP Listen Internal List.vi is not finding the named service, so new listeners continue to be created until there are too many open.  See the attached picture.  I think the circled function should be "not equal" instead of "equal".
    Has anyone run across this problem before?
    Thanks,
    Cherie
    Attachments:
    TCP Listen.PNG ‏39 KB

    Cherie,
    Let us assume that al listener for your port number and name is not yet created and you have put the TCP Listen in a loop.
    1st Iteration:
    Searching the internal list will not find a name or port and hence it will create a connection and if successful will insert the port number and name to  Internal List.
    2nd Iteration onwards:
    It will find the previous connection, provided you are still passing the  same port number. If in the second iteration the port number changes, then what you say may happen
    Will it be possible for you to post the TCP VI you have in RT?
    That said...I don't get why that compare with zero is required? If port number was 0 in the first iteration then anyway after creating the listener, the new port number will be updated to the list along with the service name, isn't it?
    Message Edited by kikiduu on 09-06-2008 08:50 AM
    "A VI inside a Class is worth hundreds in the bush"
    യവന്‍ പുലിയാണു കേട്ടാ!!!

  • Error 63 and 60 from TCP Listen.vi

    Hi All,
    I got error 63 from TCP listen.vi and error 60  from retry.
    Any idea of that?
    Thanks a lot for any help.
    Anne

    The consequent error 60 is quite likely caused by the fact that Winsock does not close a socket immediately in order to handle lingering packets that might still be arriving for that socket. So your Listen tries to open a socket, but somehow gets refused that socket, but it has been allocated anyhow in the Winsock library and eventhough LabVIEW closes the socket (you do executed a TCP Close node even on error on the listen refnum do you?? ) Winsock needs some time to really deallocate that socket, and when you immediately retry the port is still in use.
    Make sure to always close all refnums, also the listener refnum, even in error case and if that does not help add some delay before retrying to open the Listener again.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • TCP Listen.vi " trabado "

    Hola, saludos a quien lea este tema.
    La situacion es, tengo un cliente y un servidor, el servidor siempre esta esperando que el cliente se active y el TCP listen.vi en el servidor se active con un tiempo infinito de espera, sin embargo esto no ocurre despues de algunos dias de estar funcionando correctamente. No marca ningun error simplemente no responde a las peticiones del cliente. 
    La pregunta es: ¿Por que deja de funcionar el TCP listen.vi del servidor y si es posible que exista alguna degradacion de este?
    Nota: Cabe señalar que existe comunicacion entre el cliente y servidor, esto fue probado con un "PING"obteniendo respuesta y aun asi el tcp listen deja de funcionar o de reconocer que el cliente le esta escribiendo.

    Hola Jonathan no debería de
    haber motivo para que se interrumpa la conexión o se degrade la señal, aquí
    puede manejar esto dependiendo de la arquitectura de tu programa. Las desconexiones
    en red se pueden dar por muchos motivos, por lo que seria bueno agregues algo
    para que pueda volver a establecer conexión. Con respecto al lis tener, a lo
    mejor el sistema operativo o el antivirus lo bloquea por la actividad o algo
    mas trato de conectarse.
    Aquí lo que puedes hacer es
    colocar un timeout grande y si se da, simplemente que regrese al mismo estado y
    vuelves abrir la conexión con esto la puedes mantener fresca.
    Saludos
    Benjamin C
    Senior Systems Engineer // CLA // CLED // CTD

  • TCP Listen only accepts 1 packet

    Hello,
    I am trying to create a RS232 to TCP/IP converter VI. I am trying to use this VI to allow my main VI to communicate with a microcontroller (using rs232) over a network and I do not have access to a hardware converter.  The VI works great for sending data from the microcontroller ( rs232 -->TCP) but I am having problems getting information to the microcontroller (TCP --> rs232). I have tried numerous server configurations using the TCP Listen and Create Socket. For some reason I can only seem to receive a packet when using TCP Listen and no while loop but then it only receives 1 packet and none after that. I have used other programs to verify that the main VI is correctly sending the packet to that port and have verified that the problem is in this VI. 
    The following image is the "working" version that only receives the first packet sent to it 
    The following two pictures are the other configurations I've tried but they receive no packets.  
    TCP Listen with while loop 
    TCP Wait on Listener
     If you can provide any help it will be much appreciated.
     Thank you,
                 meanmon13
    Solved!
    Go to Solution.

    Those wont work because you aren't thinking dataflow. Dataflow means each piece will execute when all the inputs to it are available. Your first while loop runs forever. There is an input to the second while loop coming from the first while loop. Hence, it will never get to your second while loop, and thats why you aren't receiving anything.
    Put everything in one loop and use error wires to control the order
    Message Edited by for(imstuck) on 06-09-2010 11:26 AM
    CLA, LabVIEW Versions 2010-2013

  • Can VISA create a TCP listener?

    I know the TCP primitives allow me to create a TCP listener, but can VISA do the same thing?  I have an application which will communicate over serial or TCP.  I need to be able to programmatically switch between the two, and so would like to use the same VISA resource wire in my application.  This works fine when I'm the one creating the connection, but with the VISA resource I have no way of receiving a connection (i.e. through a listener).  Is there a better way to do this or am I stuck using both a VISA resource wire and a TCP reference wire?
    Thanks for your thoughts,
    Robert C. Mortensen
    Certified LabVIEW Architect
    Certified LabVIEW Embedded Systems Developer
    Endigit

    I'm not trying to connect to an instrument.  I want another computer to connect to me.
    For my application, I don't want to use the VISA reference for both serial and Ethernet at the same time.  I will be using one or the other.  The setup code will obviously have to be different depending on which I'm using, but since all the messages are the same strings for either interface the rest of the code can be the same.  This all works great when I'm the one connecting to the other computer (which I have to do as well) but won't work when I'm the listener, because VISA doesn't seem to be able to create a listener.
    Robert Mortensen
    Software Engineer
    National Instruments

  • ODBC with TCPS listener

    Hi, I am using an Oracle 9i server with a TCPS (SSL-encrypted TCP/IP) listener. I can't seem to get ODBC clients working with this listener.
    I can successfully use this TCPS listener with all of the regular Oracle clients (SQLplus, Enterprise Mgr, etc.)
    I can successfully use ODBC with the TCP (non-encrypted) listener.
    When I try to connect with ODBC over TCPS (e.g. to import data into Excel), the connection freezes. Has anybody else ever successfully used the encrypted listener in this way?
    Here are my particulars:
    Database server: 9.2.0.4 on Linux
    Database client: 9.2.0.4 (both Oracle Client and ODBC driver) on Windows XP
    Any help appreciated!!
    --Andy Stevens
    New York, NY

    yes the TCPS listener is part of Oracle Advanced Security.
    --andy                                                                                                                                                                                           

  • How tcp listen works

    Hi,
      I am trying to create a connection between enc28j60 and labview via TCP protocol. the device enc28j60 is kept as a client. It has all the functions to work as a client(like sending arp request, checking if received arp reply is correct or not.. etc.,)
      To make those fumctions in a correce sequence, I need to know how TCP functions like TCP listen,TCP Read, TCP Write in LabVIEW works (the signals passed by them).
      thanks in advance
      raja

    ARP and TCP are completely different parts of the TCP/IP stack. ARP is the Address Resolution Protocol that is an underlaying part when the a conenction is established. It translates between the IP adress and the Ethernet address and nothing more. It is no usually what you are concerned at all when talking TCP, UDP or whatever since it is all handled underneath in the socket driver, which also implements TCP/IP, UDP and some other protocols that are required for a network connection.
    LabVIEW itself only works on the TCP/IP and UDP level and even that is in fact completely handled by the OS internally. All LabVIEW does is opening a socket with the socket() call, and then for listen calls bind() to bind it to the desired local address and port and then goes in a loop to use the select() call to see if an incoming connection occured. If select() returns sucessfully the LabVIEW Listen function returns and you can start doing read and write with the TCP Read and TCP WRite functions. That is all and it is all the same for every application that does TCP or UDP communication on modern OSes. No need to do anything about ARP at all, that is all handled by the OS driver and will always be the same for any application that uses the Windows (or Mac or Unix BSD) socket interface.
    So there is nothing special about LabVIEW network communication in terms of getting it to work with your Arduino. Create a small C listener on your host using any C compiler of your choice and try to connect to it from your controller. Once that works it will work for LabVIEW too. I suspect your TCP state machine in your controller is still buggy and that is why it doesn't work.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Stop tcp listen and tcp read

    Hi all,
    if i use the tcp listen and tcp read blocks with a time out of -1, how can i stop their execution if they are waiting for incoming connection or data?
    The tcp read block is in a while loop and the stop button state isn't evaluated, since the read block is in wait. 
    some one can tell me a solution to this problem compatible with S-RIO target device?
    thanks
    Solved!
    Go to Solution.

    i try to explain better with an example.
    1) run the server
    2) run the client
    3) try to stop the server without stopping the client --> the server never stops due to the infinite timeout on the reader.
    note: the client doesn't  close the connection after sending "hallo" 4 times.
    the question is: is it possible to have the server waiting for data and the stop but evaluated when pushed?
    Attachments:
    example.zip ‏15 KB

Maybe you are looking for