Example Code

Dialog Box Example with FGVs Using 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 project was created to show how to use JSON to transfer a cluster of a numeric and a string from a client to a server on either a PC or on an RT target.


Description
The project is just a demonstration on how to use the new web services in LabVIEW 2013.  It utilizes a cluster to ensure the proper type of data is transferred in each application instance.  It should be noted that the VIs on the host and target are the same, so only use 1 at a time to ensure proper functionality. 

 
Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Start your web service (right click the web service and select "Start")
  2. Check the URL for the server web method (Host Service > Web Resources > Right click on "Server-grabdata.vi" select "Show Method URL"
  3. Enter this URL into the Client.vi "URL" string control.  REMOVE THE {value} SECTION, this is added in the code as a cluster.
  4. Open both the Client and Server VI.  Run the Client VI with your selected information for the cluster and watch the server respond by unbundling the cluster.

Additional Information or References
VI Block Diagram

 

5-297-Client.png5-297-Serve.png

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

 

 

National Instruments - Tech Support

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