Managing parameters

The characteristics for Natural Access services can be altered by modifying associated parameters. Parameters are grouped together in C language structures called parameter structures. Each parameter structure has default values that are sufficient for most configurations. The parameters can be modified to enable or disable features and to adapt the service for special configurations.

Natural Access knows how to store and retrieve the values of named parameters and structures for any service. All services providing the same functionality have the same standard parameters. Services providing the same functionality but implemented on different hardware can have unique extension parameters. In addition to Natural Access named parameters, most service functions allow the application to pass a data structure to override all the parameters.

This topic describes:

Global default parameters

When you initialize Natural Access using ctaInitialize, you create and store the service descriptors and values. These are the global default parameters. When you open a service on a context, the global default parameters are copied into the context. You can modify them to define context characteristics. You can also refresh the context parameters with the global default values as needed.

The following illustration shows the parameter scope:

As specified in ctaInitialize, Natural Access uses either process local memory or system shared memory to store the global default parameters. ctdaemon must be running for default parameters to be shared among processes using system shared memory. In this case, the parameter values can be modified by a configuration file.

ctdaemon is launched with the file name containing changes to the defaults. ctdaemon creates the shared memory with the parameters and modifies the defaults. Applications subsequently launched can use the shared memory as the global defaults.

The following illustration show system shared default parameters:

When operating on a local server, parameters are always stored in the system shared memory.

If application local memory is used, changes to parameter values through ctdaemon have no effect on the application. You must use the Natural Access parameter access functions, for example, ctaSetParmByName, to modify values.

The following illustration shows the local default parameters:

Shared service parameters

When an application sets parameter values for a shared service instance, it changes these parameters for all applications that use the service. Therefore, parameters are essentially global for service instances on shared contexts. When client applications attach to shared contexts, they can use ctaGetParmInfo or ctaGetParmInfoEx to retrieve parameter settings for open service instances on the context.

Parameter definition

A Natural Access parameter is composed of the following elements:

Element

Description

ASCII name

Parameter name. For example, ADI.COLLECT.intertimeout. See Parameter naming convention.

Data type

You can define a Natural Access parameter as either a scalar data type or a string. For example, the ADI.RECORD.AGCattacktime parameter is a DWORD.

Unit

Unit associated with the parameter, such as dB or dBm. Units are primarily used for display purposes.

Value

Value associated with the parameter that can be set and retrieved. A parameter is initialized with a default value.


Parameter naming convention

Natural Access parameters are named and used according to the following syntax:

Where:

Name

Description

SvcName

Indicates the service to which the parameter belongs.

Category

Allows multiple, logically related fieldNames to be grouped.

SubStructure

Allows multiple, logically related fieldNames to be nested under a category.

FieldName

Indicates the actual parameter.


For example, the ADI service contains multiple categories, each of which contain multiple fieldNames such as:

Parameter functions

The following table lists the parameter functions. If a valid context handle (ctahd) is passed to the function, the context copy of the parameters is retrieved or modified. If the context handle is a void context handle, the global default values are retrieved or modified on the server specified by the void context handle. If the context passed is NULL_CTAHD, the global default values are retrieved or modified on the default server.

To...

Use...

Modify a single field for a given parameter name.

ctaSetParmByName

Modify a single field for a given parameter name on a specified Natural Access Server.

ctaSetParmByNameEx

Retrieve a single field for a given parameter name.

ctaGetParmByName

Retrieve a single field for a given parameter name on a specified Natural Access Server.

ctaGetParmByNameEx

Retrieve a parameter field definition.

ctaGetParmInfo

Retrieve a parameter field definition on a specified Natural Access Server.

ctaGetParmInfoEx

Retrieve parameter values for a given parameter structure.

ctaGetParms

Retrieve parameter values for a given parameter structure on a specified Natural Access Server.

ctaGetParmsEx

Reset values of all parameters on a context to the global defaults.

ctaRefreshParms

Retrieve the parameter ID for a given parameter name.

ctaGetParmID

Retrieve the parameter IDs and service ID for the named service and service manager.

ctaGetParmIds

Retrieve the parameter IDs and service ID for the named service and service manager on a specified Natural Access Server.

ctaGetParmIdsEx

Load and change parameter default values.

ctaLoadParameterFile


The Natural Access parameter functions allow you to obtain the parameter information either by specifying the parameter ID, for example, with ctaGetParmID, or by specifying the parameter name (for example, with ctaGetParmByName). The retrieval process is faster when you specify the parameter ID.

The ctaparm utility displays system parameter defaults. Refer to Natural Access parameter display: ctaparm for more information.

ctdaemon allows you to modify system global default parameters and set the global tracemask. Refer to Natural Access Server: ctdaemon for more information.

Application-specific parameters

The Parameter Management service (PRM) enables you to manipulate application-defined parameters in the same manner as other Natural Access service parameters. The application parameters are defined in ASCII text files. Use the pfencode utility to encode them as binary parameter files. The text or binary (encoded) parameter files are stored in a directory contained in the list of directories specified by the CTA_DPATH environment variable. Load the parameters by specifying the PRM service in the list of services passed to ctaInitialize.

Refer to Defining and using application-specific parameters for more information.