How Do I Use WebSockets for Data Communication in LabVIEW?

Updated Aug 20, 2018

Reported In

Software

  • LabVIEW
  • JKI VI Package Manager

Issue Details

I want to use WebSockets for data communication in LabVIEW. How do I set that up, and where can I find an example?

Solution

  1. Download and install the WebSockets package from the VI Package Manager.
    • This will add functions for WebSockets to the Data Communication package.
    • This package was developed by Sam Sharp of MediaMongrels Ltd
  2. In the Package Information page on the VI Package Manager, click "Show Examples."
  3. Open the "WebSockets Examples" project.
  4. Run the SingleConnection VI.
    • When you run this VI, a browser window will open and it will be looking for index.html in the "Test Server" folder. index.html is located in the "Test Client." Change the file path in the URL from "Test Server" to "Test Client."
    • While running, you can send data from the client to the server and vice versa.

Additional Information

WebSocket is a TCP protocol different from HTTP that facilitates real-time communication between a client and a server. 

WAS THIS ARTICLE HELPFUL?

Not Helpful