Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Mar 4, 2009


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Configuring a DataSocket Server

28 ratings | 3.14 out of 5
Print

Overview

This document describes options for configuring a DataSocket server via the DataSocket Server Manager.

Using the DataSocket Server Manager

The default DataSocket server configuration works for many intranet applications, but for some applications you might need to change the configuration. To modify the DataSocket server configuration, use the DataSocket Server Manager.

Note Changes that you make to the DataSocket server using the DataSocket Server Manager take effect the next time you launch the DataSocket server. If you change the server configuration in the DataSocket Server Manager when the DataSocket server is running, you must shut down and relaunch the server for the changes to take effect.

You can perform the following tasks with the DataSocket Server Manager:

  • Set connection specifications. You can set limits for the number of simultaneous connections to the DataSocket server and the number of items the DataSocket server can dynamically create.
  • Create predefined data items. You can specify data items that must be automatically created and given an initial value when the server launches. In the default DataSocket server configuration, only programs running on the same computer as the DataSocket server (the local host) can create items or write to items, whereas programs running on both the local host or programs running on remote computers can read items. Predefined items can have special read and write access groups. You can specify which groups can create items, write items, and read items. As a result, different machines can have individualized access to different predefined items. The DataSocket server never releases predefined items, so their values exist even when no DataSocket client is connected to them.
  • Set up permission groups. You can categorize users according to how they interact with the DataSocket server and what permission they need for connecting to the DataSocket server. Different permission groups include read access, write access, data item creators, and administrators. You also can create your own permission groups.

Note Dynamically created data items can be read by hosts in the DefaultReaders group and modified by hosts in the DefaultWriters group.

  • Modify permission groups. You can add users to permission groups using either the names of their computers or IP addresses in dotted decimal notation.
  • Import and export DataSocket Server Manager configurations. The DataSocket server uses the configuration specified in cwdssini.dss.

DataSocket Server Manager Options

You can set the following options in the DataSocket Server Manager:

Server Settings

Use MaxConnections to set the maximum number of simultaneous connections to the DataSocket server. Default: 50. Range: 1-1000.

Use MaxItem to set the maximum number of data items the DataSocket server can dynamically create, not including predefined data items added in the DataSocket Server Manager. Default: 200. Range: 1-1000.

Permission Groups

Use the Permission Groups to group hosts with similar needs. The DataSocket Server Manager provides the following default groups:

  • The Administrators permission group is reserved for future use and mainly intended for retrieving management information from the DataSocket server.
  • The DefaultReaders permission group can read all dynamically created items from the DataSocket server. Select Add Host to add a user to the group.
  • The DefaultWriters permission group can write to all dynamically created data items on the DataSocket server. Select Add Host to add a user to the group.
  • The Creators permission group can dynamically create new items on the DataSocket server. Select Add Host to add a user to the group.

You also can create additional groups for other sets of users. For example, you might need a permission group that reads only predefined items, unlike the DefaultReaders group, which reads only dynamically created data items. To create a permission group that reads a predefined data item,

  1. Click New Group.
  2. Enter a descriptive name for your new permission group.
  3. Modify the Hosts list to include the computers to which you wish to grant access. Remember that you can specify a computer either by the computer name on the network or the IP address in dotted decimal notation. The DataSocket Server Manager also has two variables, localhost and everyhost; localhost represents the local computer (the computer where the server is running) and everyhost represents all computers (unrestricted access).
  4. Select the data item to which you wish to grant access. Select your new permission group for read access.

Predefined Items

The Predefined Items category lists items created when the DataSocket server is started. These items exist without DataSocket connections, unlike dynamically created items which exist only during a DataSocket connection. As you create your DataSocket application, add data items in the DataSocket Server Manager so that you can define access permission groups for your data items.

New Data Items

To add a new data item,

  1. Click the New Item button.
  2. Enter a detailed description for the item. For example, you might list the data source, the data type, and access permissions.
  3. Enter a descriptive name for the data item.
  4. Grant read and write access to permission groups by selecting the appropriate permission group from the list.
  5. If you want multiple writers to be able to connect to the DataSocket server, enable the Allow Multiple Writers option.
  6. Specify an initial value. Remember that predefined data items exist even without a DataSocket connection. If a DataSocket Reader is connected to a pre-defined data item on the DataSocket server before a DataSocket Writer is connected, then the DataSocket server returns the initial value to the Reader. DataSocket Writers overwrite default values; when a DataSocket Writer writes to a predefined data item, that item retains the value even if the DataSocket Writer disconnects from the server. After a DataSocket Writer overwrites the initial value of a predefined item, the item does not return to the initial value unless the DataSocket server is shut down and relaunched.

Note

  • You cannot configure the DataSocket Server remotely or programmatically. You must locally configure the DataSocket server with the DataSocket Server Manager.
28 ratings | 3.14 out of 5
Print

Reader Comments | Submit a comment »

I can create predefined number, string or boolean. What about arrays or strings? Can you write me some description how can I create, for example cluster, string or path as new data item in datasocket server manager?
- Martin Štefík, STU. martin.stefik@gmail.com - May 29, 2006

 

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