Recommendations for Setting up a
Windows Data Acquisition Computer

 

This page is intended to serve as a resource for myself, my clients, and the community when someone needs to configure a Windows OS computer as a dedicated data acquisition system. Obviously, not all of these recommendations apply to every situation, and in fact these recommendations are generally tuned to my own experience and my clients needs as of the date noted above. In addition, these are only recommendations, and Original Code Consulting accepts no responsibility for any consequences of their application by a third party not related to OCC. It is also recognized that many additional recommendations could be suggested from others with experience in this area, and those suggests are welcome. Please send any such suggestions to support@originalcode.com.
When a recommendation is followed by two-letter abbreviations in bold, that indicates that that point is a requirement for installing LabVIEW software I have provided to specific clients. Any such client will have been notified of their abbreviation in a separate communication. Note, however, that MX refers to data acquisition systems using MICAS-X, and are therefore relevant to anyone who is using that program.


LabVIEW Installation

  • Installation from a DVD rather than from online greatly facilitates getting the proper modules installed.

  • Generally use default installation options.

  • Install the 32 bit version of LabVIEW and drivers, even for 64 bit OS’s.

  • It is generally best to select installation for evaluation, then choose the modules you want, and register them later, rather than have the modules chosen by serial number, since the latter will often install many modules you don’t need. (It is also possible to specify the serial number but still choose just which modules to install.  That’s fine too.)

  • Install PID and Fuzzy Logic Toolkit under Simulation and Control. MX JG VG UF

  • Install all Vision modules (NI Vision Development Module and Vision Builder) for systems integrating vision functionality. VG

  • Install Real Time, FPGA, and related Xilinx modules for systems using cRIO, myRIO, or other related hardware. JG VG UF

  • Allow the installer to check with NI for updates if you are connected to the internet.

  • Always install LabVIEW to its default location. E.g. you need plenty of room on the C: drive.

  • Multiple versions of LabVIEW generally co-exist quite well on the same computer. However, I strongly recommend installing them in ascending order, oldest first.

  • After installing the main LabVIEW modules, the installer will ask for the Device Drivers DVD. Install all required Device Drivers, including:

    • NI Max

    • NI DAQmx for the version of LV being used

  • I tend to DESELECT the NI-488 installation under Instrument Control. This driver caused problems in older versions of LabVIEW, and is only necessary if you plan to use IEEE-488 interfaces to instrumentation.

  • After LabVIEW has been installed, if it was done without a serial number, run the NI License Manager from the Start menu to register all the modules.

  • If Shared Variables are being used, the firewall must be adjusted to let them communicate, or the firewall must be turned off completely. Check www.ni.com for more recent instructions for the firewall adjustments, but as of November, 2016, these instructions were sufficient: JG VG UF

To allow the Shared Variables through Windows Firewall:

    1. Go to the Advanced Settings for Windows Firewall.

    2. Set up new rules to allow TCP and UDP inbound packets on port 2343. Instructions say to allow server-discovery broadcasts, but I couldn't find that option.

    3. Allow TCP ports 59110-59115. Instructions don't say if it should be inbound or not, so I did rules for both. One port must be opened for each "Application" for TCP ports, so this will allow up to 6 applications using Shared Variables.

    4. Open UDP ports 6000 to 6010 for incoming packets.

    5. Allow the following programs through the firewall:

      C:\Windows\SysWOW64\lkads.exe

      C:\Windows\SysWOW64\lktsrv.exe

      C:\Program Files (x86)\National Instruments\Shared\Tagger\tagsrv.exe

    6. I named all these rules "Shared Variables" so that they could be searched for.

  • Turn off automatic updates from the NI Update Service. To do this, run “NI Update Service” from the National Instruments folder in the start menu. Select Preferences in the File menu. (Note that you may have to wait for it to stop searching for updates before you can change preferences.) Deselect “Enable Periodic Checking”, and change “after downloading updates” to “save updates”.

  • For any LabVIEW program that uses Shared Variables, be sure to remember to “Deploy” those shared variables at least once when you put the program on a new computer. Once they are deployed, the Shared Variable Engine on that computer will remember them. But if they have not been deployed even once, they will not work on that computer. To deploy the Shared Variables, find their library in the LabVIEW project, right click on it, and select Deploy. JG VG UF


OS Setup

  • Avoid installing any software or drivers that are not absolutely necessary for the specific data acquisition task. E.g. it is recommended that no one browse the web, play games, or look at data in Excel or other programs while the computer is acquiring data. The best way to prevent this is to not install any such programs. This has the side benefit of keeping the OS cleaner and the hard disk less crowded. However, it is not recommended that you uninstall Internet Explorer. Several National Instruments tools are integrated with IE, and occasional access to the internet can be invaluable.

  • Consider disabling or uninstalling antivirus software. Some antivirus applications cooperate quite well with data acquisition systems. Others can cause serious timing glitches. Windows Security Essentials (now deprecated by Microsoft) seems to behave fairly well. It is uncertain if Windows Defender does or not. Note that many organizations must comply with their specific IT regulations in this regard, and removing anti-virus protection may be contrary to those regulations.

  • Consider turning Windows auto-updates off. In the past, there have been times when an OS update caused a data acquisition system to no longer operate, though this was many years ago and recent updates have generally been very robust.

  • Definitely configure auto-updates so that they will not reboot the computer at their whim. This can be done by configuring them to always ask before installing, or by setting a registry parameter that prevents automatic rebooting. Google “no reboot after auto update” for more information.

  • Set the power options so that the screen and hard disk never turn off when the computer is plugged in. Disable all sleep and hibernate settings.

  • Turn off screen savers.

  • Turn off the “aero” graphics options. To do this, set the DWM (Desktop Windows Manager) service to “Manual” start.

  • Uninstall any unnecessary software, especially “free” and trial programs that come preinstalled on many machines.

  • It may also be helpful to review the services that are being started by default, and perhaps remove some programs that are starting unnecessary services, or set some services to start on demand rather than at startup.

  • Disable all indexing that the OS does. In Control Panel, search for “index” and double click on that option. In the new window, click on Modify, then deselect all directories until no Included Options remain. Close the Modify window and also deselect all checkboxes in the main Indexing window.

  • Be very careful about what AC adapter is used with each laptop. When an undersized or unrecognized power supply is used with some Dell laptops, they can revert to a low CPU frequency for power saving, and performance can decline drastically. It may be useful to use the AllCPUMeter gadget at AddGadgets.com to monitor the CPU clock speed to help diagnose this issue. JG VG

  • It is a good idea to turn off AutoRun and AutoPlay, since infected USB drives can spread viruses just by being plugged in when this is on. To turn these off, use Regedit to create or edit the DWord "NoDriveTypeAutoRun" with a value FF hex, in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer. It may be necessary to create the Explorer folder if it does not already exist.

Updating Policy

It is critical that no one update the data acquisition computers’ OS or NI software without ensuring that they are following prescribed guidelines. Applying any update before it has been vetted can result in failure of the system to operate correctly. Applying an update without synchronizing with the entire group can create massive maintenance issues. JG VG UF

Network and Routing setup (Shared Variables/Dual Network solution)

There has been an ongoing issue where machines that use both network adapters (wired and wireless) have difficulty with LabVIEW Shared Variables. Generally the LabVIEW devices are all on the wired network, and the wireless network is used to connect to a wireless router with access to the Internet, or other required services. There are a few things that can be done to resolve this issue.

  1. In Microsoft’s great wisdom it was decided that wireless network adapters, when present, will be elected the “default” network adapter. The following instructions will show you how to “promote” the wired network adapter to be the “default” adapter:

    Start=> Run…=> ncpa.cpl (this is just a quick way to get to the Network Connections Adapter Setting page) => Press Alt-n-s (or Alt, then select Advanced menu->Advanced Settings…).  In the “Connections” box on the “Adapters and Bindings” tab Move the “Local Area Connection” to the top of the list by highlighting it and using the up arrow buttons on the right of the window. I also suggest moving any VPN connection just below the top item followed by the “Wireless Network Connection” that corresponds to the actual Wireless network card, followed by any“virtual” wireless connections (“Wireless Network Adapter X” which are labeled as Microsoft Virtual WiFi Miniport Adapters when viewed in the “Network Connections” window). Remote Access Connections and any other connections should come last. Click the “OK” button.

  2. If there is an “Instrument” network that is not connected to the internet (or another network via a router), the DEFAULT GATEWAY should NOT be set. I also recommend removing or disabling the TCP/IPv6 protocol for all adapters that don’t need it. The following will only work if the computer is configured with a static IP address:

    Start=> Run…=> ncpa.cp l=> right click on the wired network adapter (LabVIEW devices, not internet connected) => Properties => uncheck “Internet Protocol Version 6 (TCP/IPv6)”. Highlight “Internet Protocol Version 4 (TCP/IPv4) with the mouse and press the “Properties” button => under “Use the following IP address:” Delete all numbers in the “Default gateway:” box. Press OK to close the IPv4 Properties, and OK again to close the Properties window.

  3. Here we will manually override the network “Cost” (i.e. METRIC) of all active network adapters to help prioritize the computer’s routing table for the wired network adapter.  Should any conflict arise, this may help keep LabVIEW traffic flowing over the wired network. For each active network adapter, follow the instructions below to manually override the Connection’s Metric. I suggest the following settings:

    Wired “Local Area Network” connection(LabVIEW) : Metric 10
    Bluetooth Adapter (if present): 1500
    Wireless Network Adapter Connection (i.e. the actual wireless card): 2000
    Any other active connections, just increment from the Wireless Network by 500...

    To get to these settings:
    Start => ncpa.cpl => right click on the connection => Properties => select TCP/IPv4 protocl => Properties => Advanced… => uncheck “Automatic metric” => enter the appropriate value (see above). Click OK to close the “Advanced TCP/IP settings,” OK to close the “TCP/IPv4 Properties,” and OK again to close “XXX Connection Properties” windows.

  4. Setting permanent static routes. I believe this step is not necessary, and I recommend only trying this after implementing 1-3 above if you are still having issues with shared variables. Setting permanent static routes could lead to confusion down the line if a computer is repurposed for another task using different network settings and someone doesn’t remember to delete the static routes.

    Start => All Programs => Accessories => right click on “Command Prompt” and select run as Administrator. Click Yes to allow UAC to run the program with Administrative privileges. This example assumes that the wired network connection uses a statically assigned network address of 192.168.1.50, and that using the command shown in 5 below you determine that the wired ethernet adapter is interface 11:

    route add -p 192.168.1.0 mask 255.255.255.0  metric 10 IF 11

    The “-p” makes this a persistent route that survives a reboot. You can test a route add statement without the -p. If it causes problems, rebooting or shutting off and restarting the computer should clear that route. If you want to remove the persistent rout entered above you could use the following command:

    route delete 192.168.1.0

  5. netstat -rn - A useful command prompt command to look at the routing table, and to determine the interface number for a particular adapter


Windows 10 Issues

Windows Updates

Among other changes, Windows 10 has locked down the options for how Windows Updates are installed. Without going in to more advanced settings, one cannot prevent the computer from rebooting on its own after an update. One way to prevent this in Windows 10 is as follows:
    1. Search for Group Policy in the Control Panel. This should launch the Local Group Policy Editor.
    2. Under Administrative Templates, expand Windows Components. Then click on Windows Update.
    3. In the left pane, double click on Configure Automatic Updates. This opens another dialog box.
    4. Select Enabled near the top.
    5. Select "3 - Auto download and notify for install" or whichever option is most appropriate for your system in the lower left.
    6. Click on OK.
    7. These changes will not take effect until the system checks for Windows Updates once. To force this check, search for Windows Update in the Control Panel, then press the "Check for updates" button.

If the above configuration is used, updates will be downloaded to the computer in the background, but only installed when the operator chooses. For some systems, it may be better to prevent updates from being downloaded completely. Note that with this tweak, the OS will still enforce a reboot within a few days after you allow it to install an update.

To prevent the OS from ever rebooting the computer when a user is logged in, launch gpedit.msc from a cmd window. Navigate to Computer Configuration/Administrative Templates/Windows Components/Windows Update. Double click on "No auto-restart with logged on users for scheduled automatic updates installations". Enable it and click apply. This can done by editing the registry using Regedit and making the key "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" NoAutoRebootWithLoggedOnUsers (DWORD) have a value of 1.
For Home edition, it is not possible to edit Group Policies. This link has information on another way to prevent Windows from rebooting itself.
Even after the above edits, it Windows will still try to push certain updates. Once they have been received, it will eventually force a reboot. The only way to prevent this type of forced reboot is to prevent the forced updates from being installed. This link has information on how to do that.


Recommendations for Operating a Windows Data Acquisition Computer

Once a data acquisition system has been set up, there are several common-sense guidelines for how it should be maintained and operated. Two cases are described here. The first, which is less common, applies to systems that are not connected to the internet. The second applies to data acquisition systems that are connected to the internet. The final section includes general recommendations relevant to both types of systems.

Network-Isolated Data Acquisition Systems

If the data acquisition computer is not connected to the internet, it may be best to maintain a very static installation. Once the software is installed and tested, all updating mechanisms should be turned off. This includes LabVIEW, Windows Updates, anti-virus, and any other installed programs that may have automatic updating mechanisms. (Since the computer is not on the internet, these updating mechanisms will not normally be able to automatically engage themselves, but turning them off adds an extra layer of protection in case the network is ever connected, even briefly.) For this type of system, it is often possible to disable or uninstall antivirus programs, firewalls, and other anti-malware programs. It can also be useful to uninstall other programs that may have been pre-installed on the computer by the manufacturer. Once the system has been completely configured this way, it is a good idea to create a disk image or backup of the system, which can later be used to recreate the known-good configuration if the hard disk should fail.

Network-Connected Data Acquisition Systems

When a data acquisition computer is connected to the internet, it is generally a good idea to leave firewalls, anti-virus, and automatic operating system updates turned on, to help ensure that the computer remains secure as threats evolve. It is possible, though generally unlikely, that updates to these services will adversely effect the data acquisition system, but that risk is generally less than the risk posed by malware. It is still recommended that automatic updates to NI software and LabVIEW be turned off. NI software updates are generally trouble-free, and sometimes include security patches. But on a data acquisition computer, these updates should done intentionally by the computer administrator, after being carefully reviewed, not automatically.

 Any additional software installed on a data acquisition computer, especially anti-virus and anti-malware software, should be from reputable vendors and should have well-established reputations for robust operation. Some anti-virus programs in particular can be intrusive and cause issues with data acquisition performance. OCC tends to use the anti-virus programs built into Windows 7 and Windows 10. Although those programs are not always rated as highly as others in providing protection from all viruses, they are generally rated fairly high, and they have been found to be non-intrusive and to not adversely affect most data acquisition applications.

All Data Acquisition Systems

In the ideal situation, a data acquisition computer will be used only for its dedicated data acquisition purpose. In this case, no software not required for the data acquisition system should be installed on the computer, and no other programs should be run on the computer. In reality, there are often cases where a computer must serve more than one purpose. In these cases, all software to be installed on the data acquisition computer should be reviewed carefully to ensure that it really is necessary. It is always best to limit the number of programs and drivers installed, to reduce the chances of incompatible software impairing the data acquisition functionality. In addition, when other programs ARE installed on a data acquisition computer, it is highly recommended that none of them are run and used in parallel with the data acquisition program. Although it is common to see web browsers and Excel run while a data acquisition program is also running, and often this can be done with no adverse effects, it is still advised to avoid this practice whenever possible.
Disk defragmenting seems to be much less needed on modern computers than it was some years ago. OCC generally does not recommend using disk defragmenting programs.
Backing up your data acquisition computer is always a good idea. Many options are available for automatic backup systems. Unfortunately, many of these programs suffer from a simple bug: when backing up files, they appear to require read/write access to the files, rather than read-only access, which seems like it should be sufficient. When these programs attempt to backup data files that are currently open in a data acquisition program, errors can result, either in the backup or in the data acquisition program. It is therefore highly recommended that automatic backups be configured in such a way as to only backup data files that have been closed. For example, on a system which runs continuously 24/7, it may be useful to put data files in a date-stamped folder structure with a new folder started each day. The backup program can then be instructed to only backup folders that are at least one day old.