DNPVariable (DNP Variable)

The DNPVariable instruction sets up the ClosedDNP Distributed Network Protocol is a set of communications protocols used between components in process automation systems. Its main use is in utilities such as electric and water companies. implementation in the datalogger that is a DNP outstation device.

Syntax

DNPVariable ( Source, Swath, DNPObject, DNPVariation, DNPClass, DNPFlag, DNPEvent, DNPNumEvents)

Remarks

DNPVariable is a DNP outstation instruction and must be used with a DNP and DNPUpdate instruction.

Parameters

Source

The name of the Variable that is the input for the instruction. Right-click the parameter to display a list of defined variables.

Type: Variable

For the DNPVariable instruction, the Source parameter is a public variable or variable array that specifies the source of data to populate the DNP outstation array. This variable must be of type ClosedLong Data type used when declaring a variable as an integer. for Analog Input or Analog Output Objects, unless the variation specified is single precision floating point (see DNPObject), in which case the variable must be of type ClosedFloat Four-byte floating-point data type. Default datalogger data type for Public or Dim variables. Same format as IEEE4.. If the object specified is a Binary Input or Binary Output, then the source variable must be of type ClosedBoolean Data type used to represent conditions or hardware that have only two states (true or false) such as flags and control ports..

Swath

The number of values of the array over which to perform the specified operation.

Type: Constant (or expression that evaluates as a constant)

For the DNPVariable instruction, the Swath parameter is the number of elements that are in the DNP outstation array. This number must be equal to or less than the length of the array the data is mapped from in the Source parameter. An array index can be specified in Swath to write a class to a specific element or series of elements within the array. For example, with an array of 10, such as BinaryInput(10):

DNPObject (DNP Object)

The DNPObject parameter assigns the Source parameter to a specific DNP object type. DNP data is organized into arrays with different Object types. The Objects are divided into groups and each group has variations of that group. All communications are referenced from the DNP master. For example the “Analog Input” object means the Master is requesting data from a datalogger DNP outstation array.

Type: Constant

DNPVariation (DNP Variation)

Assigns the Source parameter to a specific variation, which describes the data format within its Object group. Datalogger supported DNP objects and variations:

NOTE: Object 0 device attribute variations are read only and cannot be specified in the DNPVariable instruction. Rather, they are sent only when requested by a master device.

Object Variation Description
0 240 Device attribute, maximum transmit fragment size
0 241 Device attribute, maximum receive fragment size
0 242 Device attribute, OS version
0 243 Device attribute, rev board, TI chip
0 247 Device attribute, station name
0 248 Device attribute, serial number
0 250 Device attribute, product name and model
0 252 Device attribute, name of device manufacturer
0 254 Device attribute, return all devices attributes in single response
0 255 Device attribute, retrieve all of the supported device attribute variation numbers
1 1 Static, Binary Input
1 2 Static, Binary Input with Status
2 1 Event, Binary Input Change without Time
2 2 Event, Binary Input Change with Time
2 3 Event, Binary Input Change with Relative Time
10 1 Static, Binary Output, Packed Format
10 2 Static, Binary Output Status, with Flags
12 1 Binary command, control relay output block (CROB)
20 1 Counter, 32-bit with flag
20 2 Counter, 16-bit with flag
20 3 Counter, 32-bit with flag, delta
20 4 Counter, 16-bit with flag, delta
20 5 Counter, 32-bit without flag
20 6 Counter, 16-bit without flag
20 7 Counter, 32-bit without flag, delta
20 8 Counter, 16-bit without flag, delta
21 1 Frozen counter, 32-bit with flag
21 2 Frozen counter, 16-bit with flag
21 5 Frozen counter, 32-bit with flag and time
21 6 Frozen counter, 16-bit with flag and time
21 9 Frozen counter, 32-bit without flag
21 10 Frozen counter, 16-bit without flag
22 1 Counter event, 32-bit with flag
22 2 Counter event, 16-bit with flag
22 5 Counter event, 32-bit with flag and time
22 6 Counter event, 16-bit with flag and time
30 1 Static, 32-Bit Analog Input
30 2 Static,16-Bit Analog Input
30 3 Static, 32-Bit Analog Input without Flag
30 4 Static, 16-Bit Analog Input without Flag
30 5 Analog input, single precision floating point with flag
32 1 Event, 32-Bit Analog Change Event without Time
32 2 Event, 16-Bit Analog Change Event without Time
32 3 Event, 32-Bit Analog Change Event with Time
32 4 Event, 16-Bit Analog Change Event with Time
32 5 Analog input event, single precision floating point without time
32 7 Analog input event, single precision floating point with time
40 1 Analog output status, 32-bit with flag
40 2 Analog output status, 16-bit with flag
40 3 Analog output status, single precision floating point with flag
41 1 Analog output, 32-bit
41 2 Analog output, 16-bit
41 3 Analog output, single precision floating point
50 1 Read, Time and Date
60 2 Class 1 Data
60 3 Class 2 Data
60 4 Class 3 Data
110 X Octet string; variation parameter is used to declare maximum length of string

Type: Constant

DNPClass (DNP Class)

Assigns the Object class to the Source parameter. Valid classes are 0 for static data or 1, 2, and 3 for event data.

Type: Constant

DNPFlag (DNP Flag)

A constant, expression, variable, or variable array that indicates the value of the DNP3 data quality flag corresponding to the Source parameter. If a constant is used, then by default, all quality flags will be set to online, regardless of the value entered (for example, 0 or 1 both evaluate to ‘online’). If a variable or variable array is used, the variable must be declared as a data type of Long, and the DNP3 flags will reflect the value of the variable or variable array. The variable or variable array can then be set under program control. A 1 sets a quality flag to online; a 0 sets a flag to offline.

If the array for the flag parameter is smaller than the array for the source parameter, then the last element of the flag array is used for all of the remaining source array elements. A single variable (scalar) is treated like an array of one element.

Type: Variable or Constant

DNPEvent (DNP Event)

Used to create event data. An expression or variable array may be entered and used to trigger the creation of change events. If a variable or variable array is used, it must be of type Long. If the array is smaller than the source array, the last element of the array is used for all the remaining array elements. A single variable (scalar) is treated like an array of one element. Any time the event trigger variable evaluates as true, a change event will be created for the Source parameter.  This allows the user to define the conditions that create change events. The default value is zero and indicates that a change event will be created whenever there is any change to the value of the Source parameter.

Type: Variable or constant

DNPNumEvents (DNP Number of Events)

The number of events that will be saved in the history before events are successfully received at the master; that is, the size of the history. For event objects, this number must be greater than 0.

Type: Constant or variable