Why Is My LabVIEW VI Not Receiving WebSocket Data?

Updated Aug 10, 2025

Issue Details

I am trying to use WebSocket communication to get data into LabVIEW using a simple VI I made, but the data is not coming through. When I open the same IP address in a browser on my PC, I can see the data just fine. I can also send data from an Android application using WebSocket and read it in the browser without any issues. There are no errors showing in LabVIEW but the stop button in my While loop does not works. Therefore, I think something might be wrong with how I set things up in the VI but how can I check it?

Solution

There are several possible reasons as to why data is not being received in LabVIEW via WebSocket. Follow the recommendations below to debug the issue:

  1. Check Handshake.vi Error Output

    Adding Handshake.vi is a correct way, but it is also important to verify whether the handshake complete successfully. It is recommended connecting an indicator to the error output of the Handshake.vi.

     
    Alternatively, you can add an error handling function after the Close.vi to help identify where any errors might be occurring.

     
  2. Add a Wait Function in the While Loop

    It is possible that the Read.vi is executing before the data arrives, which could be why you are not receiving anything. To address this, add a Wait function (100-200 ms) inside the While Loop. Also, use the Timeout ms input of Read.vi together with the Wait function to prevent the VI from blocking indefinitely and to allow periodic checks for new data.

     
  3. Check Firewall and Antivirus Settings

    Firewall or antivirus software may be interfering with LabVIEW's WebSocket communication. Try temporarily disabling these programs when running the VI to see if it resolves the issue.

  4. Use Sample VIs for Reference

    The WebSocket Toolkit includes sample VIs that may help you verify your setup. You can find them at the following path:
    C:\Program Files\National Instruments\LabVIEW <version>\examples\MediaMongrelsLtd\Websockets