Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: Sep 06, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Using Advanced DataSocket Commands with FieldPoint Ethernet Network Modules

8 Ratings | 1.62 out of 5
Print | PDF

Overview

This document discusses tips for using DataSocket VIs and explains the advanced DataSocket commands. If you are not already familiar with DataSocket VIs and want to learn more, please go to Introduction to Using DataSocket Commands to Communicate with FieldPoint Ethernet Network Modules on Developer Zone.

Caution. This document is for advanced users who want to configure their FieldPoint system remotely. If you use the DataSocket commands described in this document incorrectly, you can change the characteristics of your control system resulting in damage to the process or device your FieldPoint system is controlling. Do not use the DataSocket commands in this document unless you are an advanced user and are comfortable with DataSockets.

Table of Contents

  1. Tips for Using the Lookout Protocol of DataSocket VIs
  2. Advanced FieldPoint I/O Module-Specific DataSocket URLs
  3. Advanced FieldPoint System-Specific DataSocket URLs

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

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.

LabVIEW RT 6.1
The DataSocket Read or Write VI consumes approximately 600 KB of memory (RAM) for the very fist read or write call, and consumes approximately 10 KB for every read or write call afterwords.

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
LabVIEW RT 6.0.3
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.

LabVIEW RT 6.1
You can now multiplex an array of URLs into a DataSocket Read VI. The DataSocket Write VI still requires to use one DataSocket Write VI per 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
LabVIEW RT 6.0.3
Currently, you cannot acquire the quality or the timestamp of a Lookout item when you use DataSocket.

LabVIEW RT 6.1
You can now retrieve the Quality and Timestamps of Lookout items by using the FieldPoint Network Read VI located on the FieldPoint»DataSocket palette.


DataSocket Write Failure for Lookout Items
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.

Advanced 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.

Module Persist Command
The Module Persist Command part of a URL stores the channel range, channel attributes, and start up in factory configuration flag by moving these settings from volatile to nonvolatile memory (Flash). You must write a 1 for the module to move these settings to Flash. The module configures itself according to this stored configuration when it starts up from a reset or a power cycle. The Module Persist Command part of a URL has the following format:

\\machine\FP\Control\Persistn

where n is the address of the I/O module. 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 Module Persist Command is shown in the following figure.



Channel Range
Use the Channel Range part of a URL to access the range of a specific channel. If you want to save the Channel Range that you configure, call the Module Persist Command (see the Module Persist Command section of this document). The Channel Range part of a URL has the following format:

\\machine\FP\module\channel\ConfiguredRange

where the value accessed is the configured range of the channel which you can find in the Get Attributes and Set Attributes sections of the FP-1000/1001 Programmer Reference Manual.

An example of a DataSocket URL with Configured Range is shown in the following figure.



An alternative to using the Channel Range command for your DataSocket VI is to use the FP Configure Range VI which is installed with FieldPoint Explorer 3.0.1 and later. For more information on the FP Configure Range VI, in LabVIEW go to Help»FieldPoint VIs and navigate to the FP Configure Range section.

Channel Attributes
Use the Channel Attributes part of a URL to access the attributes of a specific channel. If you want to save the Channel Attributes that you configure, call the Module Persist Command (see the Module Persist Command section of this document). The Channel Attributes part of a URL has the following format:

\\machine\FP\module\channel\Attributes\attribute

where attribute is name of the attribute which you can find in the Get Attributes and Set Attributes sections of the FP-1000/1001 Programmer Reference Manual. Only the least significant bytes of multibyte attributes are listed.

An example of a DataSocket URL with Channel Attributes is \\130.164.58.44\FP\1AI\05\Attributes\InputFilter

An alternative to using the Channel Attributes command for your DataSocket VI is to use the FP Configure Attribute VI which is installed with FieldPoint Explorer 3.0.1 and later. For more information on the FP Configure Attribute VI, in LabVIEW go to Help»FieldPoint VIs and navigate to the FP Configure Attribute section.

Channel Commands
Use the Channel Commands part of a URL to access the commands of a specific channel. The Channel Commands part of a URL has the following format:

\\machine\FP\module\channel\Commands\command

An example of a DataSocket URL with Channel Commands is \\130.164.58.44\FP\3CTR\05\Commands\Control where writing a 1 would reset the counter on channel 5 and writing a 2 would increment the counter.

Module Reset Commands
The Module Reset Commands part of a URL set the FieldPoint module to the factory default configuration or to a predefined user configuration that is determined by the Factory Configuration Flag. When a 1 is written to the module, the settings of module n are restored to factory defaults if the Factory Configuration Flag is set. The Module Reset Commands part of a URL has the following format:

\\machine\FP\Control\ResetModn

where n is the address of the I/O module. 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.

Advanced FieldPoint System-Specific DataSocket URLs



The following sections describe the FieldPoint system-specific DataSocket URLs. The variables for which you need to enter values are in italics.

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.



Reset Command
The Reset Command part of a URL sets the FieldPoint bank to its factory default configuration or to a predefined user configuration as specified by the factory configuration flag. When the factory configuration flag is equal to 1, the module resets itself to factory default settings on startup. When the factory configuration flag is equal to 0, the module uses the user-defined configuration settings that are stored in the nonvolatile memory (Flash). The Reset Command part of a URL has the following format:

\\machine\FP\Control\Reset

An example of a DataSocket URL with Reset Command is shown in the following figure.



Start Up in Factory Configuration Flag
The Start Up in Factory Configuration Flag part of a URL configures a FieldPoint bank to use the factory default settings any time you reset a FieldPoint module or bank, or when the network module is rebooted. When the factory configuration flag is equal to 1, the module resets itself to factory default settings on startup. When the factory configuration flag is equal to 0, the module uses the user-defined configuration settings that are stored in the nonvolatile memory (Flash). If you want to save the Start Up in Factory Configuration Flag settings that you configure, call the Module Persist Command (see the Modules Persist Command section of this document). The Start Up in Factory Configuration Flag part of a URL has the following format:

\\machine\FP\Control\StartInFactoryConfig

Snapshot Command
The Snapshot Command part of a URL provides you with a single-step method for saving all of the current settings, such as ranges, attributes, and current output data values, as the power-up state for the bank. When 1 is written to the Snapshot Command, all modules in the bank store their current channel outputs as the power-up outputs. The Snapshot Command part of a URL has the following format:

\\machine\FP\Control\Snapshot

An example of a DataSocket URL with Snapshot Command is shown in the following figure.



Hide Configuration Settings
The Hide Configuration Settings part of a URL allows a user to hide the configuration settings (channel and range attributes) when another user is browsing the FieldPoint bank. When the Hide Configuration flag is set to true, configuration settings are not listed under the FieldPoint modules when you browse in the Browse for Item dialog box. If you want to save the Hide Configuration Settings that you configure, call the Module Persist Command (see the Module Persist Command section of this document). The Hide Configuration Settings part of a URL has the following format:

\\machine\FP\Control\HideConfigurationSettings

Version String
The Version String part of a URL returns a hex string representation of the version number of the firmware being used by the FieldPoint network module. The Version String part of a URL has the following format:

\\machine\FP\Control\Version

An example of a DataSocket URL with the Version String is shown in the following figure.



Watchdog Occurred
The Watchdog Occurred part of a URL indicates if the FieldPoint bank is in Watchdog mode. The watchdog timeout returns a nonzero number if a timeout has occurred since the last time the variable was set to zero. The Watchdog Occurred part of a URL has the following format:

\\machine\FP\Control\WatchdogOccurred

Watchdog Timeout
Use the Watchdog Timeout part of a URL to specify the maximum allowable period of lost communication with hosts or clients over the network. The Watchdog Timeout part of a URL has the following format:

\\machine\FP\Control\WatchdogTimeout
8 Ratings | 1.62 out of 5
Print | PDF

Reader Comments | Submit a comment »

Wrong?
This document shows using back slashes in the URL. While http://zone.ni.com/devzone/cda/tut/p/id/44 99#toc1 calls for forward slashes.
- Wayne Crawfis,Franklin Electric. wcrawfis@fele.com - Apr 02, 2009

 

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/).