Example Code

Limit the Number of Connections for Remote Front Panel with LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This application limits the amount of simultaneous connections to an application through Remote Front Panel.

 

Description

Many LabVIEW users have licenses to deploy a remote front panel and have more than one person to be able to view that front panel.  Most of the time, this is a great tool that users can access the front panel from the web.  Although there may be certain VIs that you don't want more then one person to be able to access.  To be able to implement this fuctionallity, all you need is a property node and an invoke node.  These nodes are used to take information from the webserver and close those connections.

 

Requirements

  Software

  • LabVIEW 2012  (or compatible)

 

Steps to Implement Code

This snippet would need to be inserted into a loop structure in order for this to work, because while the code is being run it will constantly look for who is connected to the front panel.  If that number of people exceeds the amount specified in "Limit Client connections" then that client address is closed and cannot see the front panel.  The VI attached has this code implemented in a simple incremental counter.

 

Additional Notes

Once the code is written in your VI, or you are using the download  example provided, you will need to make sure your webserver is running  in Tools->Options->Web Server.  Make sure the 'Enable Web Server'  is checked.  Then Restart LabVIEW and open the VI and go to Tools->Web  Publishing Tools.  Once your VI is deployed you can control the number  of clients that can connect to it.

 

Block Diagram

 Limit Remote Front Panel Connections - LV2012 NIVerified.PNG

  

**This document has been updated to meet the current required format for the NI Code Exchange.**

National Instruments
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.