Introduction to Using DataSocket Commands to Communicate with FieldPoint Ethernet Network Modules
Overview
DataSocket is a programming technology based on industry-standard TCP/IP. It simplifies the live data exchange between different applications on one computer or between computers connected over a network. DataSocket was designed as an easy-to-use, high-performance programming interface for sharing and publishing live data in measurement and automation applications. You can use DataSocket VIs to retrieve data from other DataSocket servers, LabVIEW, Lookout, LabVIEW DSC module applications, OPC servers, Data Publishing VIs in LabVIEW, or FieldPoint controllers (such as the FP-1600 or FP-20xx).
The intended user of this document has LabVIEW 6 or higher. This document discusses how to use DataSocket to communicate with a FieldPoint Ethernet module (FP-1600 or FP-20xx) from a host computer or from an FP-20xx network module. This document also discusses some tips for using DataSocket VIs.
Table of Contents
Entering DataSocket URLs
DataSocket uses Uniform Resource Locators (URLs) to specify an absolute path to a data item. A URL consists of three separate components: protocol, network address, and locator. You are probably most familiar with URLs from using a Web browser. For example, http://www.ni.com/support/fpsupp is a Web browser URL in which http is the protocol, www.ni.com is the network address, and support/fieldpoint is the locator.
A DataSocket URL to a FieldPoint channel consists of the same three components. The following URL is an example of a DataSocket URL:
lookout://130.164.44.8/FP/1AI/01
In this URL, lookout is the protocol. Lookout is a National Instruments proprietary communication protocol that is used by FieldPoint Ethernet modules. 130.164.44.8 is the address because it is the IP address of the FieldPoint Ethernet network module. FP/1AI/01 is the locator which is read as channel 1 (01) of the analog input module in position one (the first position to the right of the network module) on the bank (1AI).
FieldPoint Explorer 3.0 installs a DataSocket URL browser if you already have LabVIEW RT 6.0.3 on your computer. If you install LabVIEW after FieldPoint Explorer, you must do a custom install. To familiarize yourself with the DataSocket URL format, follow these steps:
1. In LabVIEW, select Browse Network for DataSocket URLs from the Tools drop-down menu.
2. In the Browse Network for DataSocket URLs dialog box, enter the IP address or host name (depending on your network setup) of the FieldPoint Ethernet module with which you want to communicate in the Browse host field as shown in the following dialog box.

3. Click Refresh.
Tips For Using the Lookout Protocol of DataSocket VIs
The following sections provide tips and explain the limitations of using the Lookout protocol of DataSocket VIs.
Memory of the FP-20xx and the DataSocket VIs in LabVIEW RT 6.0.3
- The FP-20xx has 8 MB of user accessible DRAM. When you are embedding DataSocket VIs on the FP-20xx, you must consider the amount of memory utilized by the DataSocket VIs. A DataSocket Read or Write VI consumes 285 to 300 KB of memory (RAM). This limits an application to approximately 26 DataSocket VIs.
- If a DataSocket call is made when the FP-20xx has less than 200 KB of memory available, the FP-20xx returns error code 56:The network operation exceeded the user-specified or system time limit. If a DataSocket call is made when the FP-20xx has 200 to 400 KB of memory, an error message is not returned, but there may be a DataSocket Read/Write failure. National Instruments is in the process of reducing the amount of memory utilized by the DataSocket VIs.
Multiplexing an Array of URLs into a DataSocket VI
- When you multiplex an array of URLs into a DataSocket VI, only the first URL is used. Use only one URL per DataSocket Read VI or DataSocket Write VI. When you have passed the URL into a DataSocket Read VI or DataSocket Write VI, do not change the URL.
Writing Values with Lookout Protocol in DataSocket
- The Lookout protocol in DataSocket is asynchronous. When you write a value to a FieldPoint module, if you need it to behave synchronously and return a confirmation of the value you sent, you must add a delay before the DataSocket Read in your LabVIEW program.
Quality and Timestamps of Lookout Items
- Currently you cannot acquire the quality or the timestamp of a Lookout item when you use DataSocket.
- When a DataSocket Write VI fails to connect to a Lookout item, DataSocket reports an error only once. DataSocket does not report errors for successive iterations of the loop after a connection failure occurs.
Basic FieldPoint I/O Module-Specific DataSocket URLs
The following sections describe the FieldPoint module-specific DataSocket URLs. The variables for which you need to enter values are in italics.
FieldPoint Process
- The FieldPoint Process part of a URL , represented as FP in the following URL, provides the parent folder from which you access all of the FieldPoint data items. The FieldPoint Process part of a URL has the following format:
\\machine\FP
where machine is the IP address or hostname of the FieldPoint Ethernet module with which you want to communicate.
An example of a DataSocket URL with a FieldPoint Process is \\130.164.58.44\FP
I/O Module Folder
- The I/O Module Folder part of a URL provides the sub-folder from which you access all of the FieldPoint module data items. The I/O Module Folder part of a URL has the following format:
\\machine\FP\n
where n is both the numeric address of the I/O module and the letters in the I/O module name such as AI or DO. The address of the I/O module is a number 1 through 9 where 1 is the I/O module closest to the network module and 9 is the I/O module farthest from the network module.
An example of a DataSocket URL with an I/O Module Folder is \\130.164.58.44\FP\1AI
Channel Data
- The Channel Data part of a URL provides the scaled data value of the input or output value for a specific channel. The Channel Data part of a URL has the following format:
\\machine\FP\module\channel
where channel is the two-digit decimal representation of the channel which is a number between 00 and 15.
An example of a DataSocket URL with Channel Data is shown in the following figure.
Related Links:
Using Advanced DataSocket Commands with FieldPoint Ethernet Network Modules
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
