Generate a DNP3 SCADAPack Profile’s Data Programmatically

You can configure a DNP3 SCADAPack Profile’s data manually (see Manually Add one or More Rows of Vectors to a DNP3 SCADAPack Profile), or you can generate the data programmatically.

Use the see SetVectors method to configure or modify a DNP3 SCADAPack Profile’s vector programmatically using a custom program, Logic, or script. The SetVectors method’s arguments vary, depending on the type of DNP3 SCADAPack Profile for which the method is being used. For information on the arguments that you need to define for each type of Profile, see SetVectors.

When using the see SetVectors method, you need to disable the CurrentValues profile on any SCADAPack Analog Profile items that are to control the limits of points that have a ‘Physical Input’ Point Type. To do this, you specify an empty array for that particular profile’s values. If the profile is not disabled, the point’s configuration will be invalid. The way in which you specify an empty array varies, depending on the language used—for example, in VBScript, you can specify ‘nothing’ or an empty array. For other restrictions of which you need to be aware, see Limitations and Restrictions, and see SetVectors.

The rest of this section comprises a series of examples to demonstrate how you might use the SetVectors method to generate a profile’s vectors programmatically.

Example:

A series of programs were written in VBScript™ to produce a series of demonstration Daily profiles. In each case, the programs use constant values, but the values and times could equally be calculated according to a particular algorithm.

The times are in minutes, from midnight at the start of each day.

One program is used to populate a DNP3 SCADAPack Analog Profile, named ‘Demo Analog Profile’.

With the see SetVectors method, all of the Profile item’s profiles have to be defined, regardless of whether those profiles are used. With this particular Profile item, several limit profiles and the current profile are disabled. This is achieved by specifying empty arrays for those particular profiles. The empty arrays mean that the Current Value, High 4, High 3, Low 3, and Low 4 limits are not profile-controlled on the DNP3 SCADAPack point(s) with which the Profile item is associated. (Remember that for a particular limit or current value not to be profile-controlled, that particular profile have to be disabled on all Profile items that are associated with a point.)

Public Sub SetVectors

Dim Times(4)

Times(0) = 300

Times(1) = 500

Times(2) = 800

Times(3) = 1000

Times(4) = 1200

Dim High4

Dim High3

Dim High2(4)

High2(0) = 65.0

High2(1) = 70.0

High2(2) = 75.0

High2(3) = 70.0

High2(4) = 65.0

Dim High1(4)

High1(0) = 50.0

High1(1) = 55.0

High1(2) = 50.0

High1(3) = 60.0

High1(4) = 55.0

Dim Low1(4)

Low1(0) = 46.0

Low1(1) = 42.0

Low1(2) = 40.0

Low1(3) = 45.0

Low1(4) = 41.0

Dim Low2(4)

Low2(0) = 32.0

Low2(1) = 37.0

Low2(2) = 35.0

Low2(3) = 31.0

Low2(4) = 34.0

Dim Low3

Dim Low4

Dim Current

Set Profile = Server.FindObject("Demo Analog Profile")

Profile.Interface.SetVectors Times, Low4, Low3, Low2, Low1, High1, High2, High3, High4, Current

End Sub

Another program written in VBScript™ is used to populate a DNP3 SCADAPack Counter Profile, named ‘Demo Counter Profile’. This Profile item is used to control both the current value and High limit of each DNP3 SCADAPack Counter point with which it is associated.

Public Sub SetVectorsOnCounter

Dim Times(4)

Times(0) = 300

Times(1) = 500

Times(2) = 800

Times(3) = 1000

Times(4) = 1200

Dim High(4)

High(0) = 10.0

High(1) = 25.0

High(2) = 50.0

High(3) = 30.0

High(4) = 20.0

Dim Current(4)

Current(0) = 5.0

Current(1) = 20.0

Current(2) = 40.0

Current(3) = 20.0

Current(4) = 10.0

Set Profile = Server.FindObject("Demo Counter Profile")

Profile.Interface.SetVectors Times, High, Current

End Sub

A third program is used to populate a DNP3 SCADAPack Binary Profile, named ‘Demo Binary Profile’. This type of Profile item can be used to control DNP3 SCADAPack pulse action(s), or the current value of DNP3 SCADAPack Binary point(s) (providing that the latter have a Point Type other than ‘Physical Input’).

Public Sub SetVectorsOnBinary

Dim Times(4)

Times(0) = 300

Times(1) = 500

Times(2) = 800

Times(3) = 1000

Times(4) = 1200

Dim Values(4)

Values(0) = 0

Values(1) = 1

Values(2) = 0

Values(3) = 1

Values(4) = 0

Set Profile = Server.FindObject("Demo Binary Profile")

Profile.Interface.SetVectors Times, Values

End Sub



Disclaimer

Geo SCADA Expert 2021