• No results found

Network Variable Limits

CNP supports up to 4096 primary network variables and 8192 network variable aliases per device, but the maximum number may be further limited by specific CNP implementations. The typical limit for a Neuron hosted device is 254 primary network variables and 127 aliases. The maximum number of network variables and aliases per device may also be limited by the network management tool used to bind the device; different tools will have different capacities depending on their memory and database size.

The number of network variables that can be implemented on a device does not limit the number of network variables that can be accessed by the device. A single input network variable can receive data of the same type from an unlimited number of devices—potentially from every device within the domain. The receiving application can differentiate network variables from different device by examining the source address of the network variable. For example, an alarm monitoring system may have 1000 alarm output network variables bound to a single alarm input network variable on a monitoring device. This configuration only requires a single input on the monitoring device, yet the application on the monitoring device can still

determine the source of any alarm by reading the source address field of the message. A single output network variable can be used to send data of the same type to an unlimited number of devices—potentially to every device within the domain.

Network Variable Types

Network variables provide a mechanism for exchanging data values between devices, but the network variable packets do not specify the encoding of the data. For

example, two devices exchanging network variable updates representing current temperature could have different encoding for the data. If the sending device uses Celsius values with a fixed point representation providing 0.1 degree resolution, and the receiving device expects Fahrenheit integer values, the two devices would be incompatible. One solution to this problem is to add a third device in between the

The Control Network Protocol

75

two incompatible devices to perform the temperature conversion. This approach works, but unnecessarily complicates system integration.

Network variable types are used to ensure compatible interpretation of data. A standard set of network variable types defines standard units, ranges, and resolution for most common units of measure, and also defines many standard structures for common aggregate data. These standard types are called standard network variable types, or SNVTs (pronounced snivets). The list of SNVTs includes over 100 types and covers a wide range of applications. The complete list is available at

types.lonmark.org. New SNVT definitions are added when new types are required for applications created by multiple vendors. If an application requires a network variable type that is not a SNVT, device-manufacturers can define custom network variable types. These are called user network variable types (UNVTs pronounced you-nivits).

A network variable type can either be a scalar type or an aggregate type. Table 13 describes the scalar data types, and Table 14 describes the aggregate data types.

Table 13 Scalar Data Types

Data Type Description

Bitfield A signed or unsigned bitfield, 1-8 bits wide. Only available for fields within a structure or union. Double Float An ANSI/IEEE 754 standard 64-bit

double-precision floating point value with 1 sign bit, 11 exponent bits, and 52 mantissa bits, for a total of 64 bits. The maximum range is approximately -1E308 to +1E308 units.

Enumerated A signed 8-bit enumerated value.

Float An ANSI/IEEE 754 standard 32-bit floating point value with 1 sign bit, 8 exponent bits, and 23 mantissa bits, for a total of 32 bits. The maximum range is approximately -1E38 to +1E38 units. Reference A reference to a network variable type. Uses the

type definition of the referenced network variable type. If you are creating a structure or union, an individual field can reference a network variable type. If the referenced network variable type changes in some way, the referencing type or field will automatically change as well.

Signed Character An 8-bit signed character value.

Signed Long A 16-bit signed integer value. Maximum unscaled range of -32,768 – 32,767.

Signed Quad A 32-bit signed integer value.

Signed Short An 8-bit signed integer value. Maximum unscaled range of -128 – 127.

Unsigned Character An 8-bit unsigned character.

Unsigned Long A 16-bit unsigned integer value. Maximum unscaled range of 0 – 65,535.

The Control Network Protocol

76

Data Type Description

Unsigned Quad A 32-bit unsigned value.

Unsigned Short An 8-bit unsigned integer value. Maximum unscaled range of 0 – 255.

Table 14 Aggregate Data Types

Data Type Description

Structure A structure containing multiple fields. Each field may be any of the scalar types described in Table 13.

Union A union containing multiple fields. Each field may be a structure or any of the scalar types described in Table 13.

Scalar data types and fields specify scaling factors that can be used to modify the range of the type. The scaling factors are defined by three values called A, B, and C. These values are used to calculate a scaled value as follows:

ScaledValue = A * 10B * (UnscaledValue + C)

For example, the SNVT_lev_percent type is defined to represent a one-byte

percentage value. The scaling factors are defined as A=5, B=-2, and C=0, resulting in the following scaling formula:

ScaledValue = 5 * 10-3 * (UnscaledValue + 0)

Using this formula, an unscaled value of 200 results in a scaled value of 100. A value of 1 results in 0.5, providing an 0.5 percent resolution.

Scalar data types and fields define a units string that describes the data contained within the network variable or field. This string may be specified in multiple languages to allow localization of displayed values. For example, the

English-language unit string for the SNVT_lev_percent network variable type is “% of full scale.”

Units of measures are typically specified in Systeme Internationale (SI) units. For example, temperature is always represented in Celcius. A standard mechanism is provided to scale measurement values. This allows measurement values to be displayed in alternative systems. For example, temperature can be displayed in Fahrenheit using an appropriate format.

Scalar data types and fields define minimum and maximum values for the network variable type. These values restrict the values that may be assigned to the network variable or field. Scalar data types may also define an invalid value. An invalid value indicates that the value of the network variable is unknown. For example, a temperature sensor network variable output that reports an invalid value indicates that the current temperature is not available.

Network Variable Self-identification and Self-documentation

Related documents