DMC, Inc.
Windows Firewall and LabVIEW logo on a green background

Diagnosing LabVIEW: Windows Firewall and What to Do

LabVIEW can contain mysterious behaviors and errors, but perhaps the most baffling are when Windows Firewall is involved. With Windows 10 at end of life, there are new and improved firewall protections in Windows 11 that can make LabVIEW deployments challenging. DMC has worked on hundreds of LabVIEW systems with Windows Firewall interactions, and we’re sharing a few of our best tips on diagnosing and resolving the issues.

Windows Firewall and LabVIEW logos

Target Connection

Firewall issues typically emerge when communicating with multiple targets (computers or DAQ hardware). The first step when connecting to an external target is to confirm that you can at least ping it—preferably both directions. By default, Windows Firewall disables incoming ping requests to its computers.

Enabling Ping

Perform the following steps on any Windows device where you want to receive pings.

  1. Open Windows Defender Firewall and select Advanced Settings in the sidebar. Depending on your organization, you may need administrator rights or an IT employee to do this.
  2. Switch to Inbound Rules via the Getting Started page or the sidebar.
  3. Find the rule named “Core Networking Diagnostics – ICMP Echo Request (ICMPv4-In).” Right-click the rule and Enable Rule for all relevant network types (Private, Domain, Public). The rule may also be named “File and Printer Sharing (Echo Request – ICMPv4-In).”

Once you can ping back and forth between your two targets, then you know the connection is set up correctly, and any additional issues are in the LabVIEW and Windows Firewall interaction.

Windows Defender Firewall interface

Common Firewall Issues

So, how do you know if Windows Firewall is causing your problem? Here are a few common symptoms you might see.

  1. TCP or UDP messages sent between two separate LabVIEW applications on the same or different targets aren’t making it to their destination.
  2. Intermittent connection errors to external devices or computers. If connecting via TCP, this will likely manifest as Error 56.
  3. Failure to connect to NI hardware in NI MAX, or open DAQmx or IMAQdx resource connections.
  4. If using Shared Variables, errors when pulling data from the Shared Variables.

If you’re seeing unexplained or inconsistent network operation errors after you’ve confirmed that the two targets are connected, then Windows Firewall should be a suspect.

Troubleshooting and Resolution

Disable the Firewall and Add Rules

The first step to determining if the firewall is the culprit is, if possible, disabling the firewall altogether. If this resolves the issue, but you can’t leave the firewall off, then it’s time to explore adding firewall rules. NI has a list of ports that they use that can be worth enabling if you are experiencing an issue with one of their listed tools. However, it’s common for custom LabVIEW applications to use custom or dynamic port numbers. In that case, you’ll want to make firewall rules not only for the ports you’re using, but also to allow all ports for the specific LabVIEW application you’re running. Microsoft outlines some risks to doing this, as well as instructions, here. The important thing to remember is that with no firewall, the ports and applications are more vulnerable, so only allow what you actively plan to use.

Run a TCP or UDP Tester

If you’ve added firewall rules or haven’t been able to troubleshoot whether the firewall is the issue, a great way to test LabVIEW’s ability to access network resources is using a tester. LabVIEW ships with a TCP/IP communication tester. Running this for a while and logging any errors can help determine if the issues you’re encountering are intermittent and possibly firewall-related, or if there’s something else in your application causing issues. Running just this tester distills out only the network operation from LabVIEW—it’s like the LabVIEW equivalent of constantly pinging. If you’re able to run this successfully, then there may be other issues at play beyond the firewall.

TCP/IP communication tester interface

We Can Help

Fighting with the firewall, or any mysterious LabVIEW TCP connection errors, is better with a partner. If you’re looking for support as you troubleshoot existing systems or prepare to set up new ones, we’d love to help.

Ready to take your LabVIEW project to the next level? Contact us today to learn more about our solutions and how we can help you achieve your goals.