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; in JScript you have to specify an empty array (‘null’ is not supported). 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 Microsoft® JScript programs were written 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.)

var Times = new Array(5);

Times[0] = 300;

Times[1] = 500;

Times[2] = 800;

Times[3] = 1000;

Times[4] = 1200;

var High4 = new Array(0);

var High3 = new Array(0);

var High2 = new Array(5);

High2[0] = 65.0;

High2[1] = 70.0;

High2[2] = 75.0;

High2[3] = 70.0;

High2[4] = 65.0;

var High1 = new Array(5);

High1[0] = 50.0;

High1[1] = 55.0;

High1[2] = 50.0;

High1[3] = 60.0;

High1[4] = 55.0;

var Low1 = new Array(5);

Low1[0] = 46.0;

Low1[1] = 42.0;

Low1[2] = 40.0;

Low1[3] = 45.0;

Low1[4] = 41.0;

var Low2 = new Array(5);

Low2[0] = 32.0;

Low2[1] = 37.0;

Low2[2] = 35.0;

Low2[3] = 31.0;

Low2[4] = 34.0;

var Low3 = new Array(0);

var Low4 = new Array(0);

var Current = new Array(0);

var Profile = Server.FindObject("Demo Analog Profile");

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

Another JScript program 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.

var Times = new Array(5)

Times[0] = 300

Times[1] = 500

Times[2] = 800

Times[3] = 1000

Times[4] = 1200

var High = new Array(5)

High[0] = 10.0

High[1] = 25.0

High[2] = 50.0

High[3] = 30.0

High[4] = 20.0

var Current = new Array(5)

Current[0] = 5.0

Current[1] = 20.0

Current[2] = 40.0

Current[3] = 20.0

Current[4] = 10.0

var Profile = Server.FindObject("Demo Counter Profile");

Profile.Interface.SetVectors(Times, High, Current);

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

var Times = new Array(5)

Times[0] = 300

Times[1] = 500

Times[2] = 800

Times[3] = 1000

Times[4] = 1200

var Values = new Array(5)

Values[0] = 0

Values[1] = 1

Values[2] = 0

Values[3] = 1

Values[4] = 0

var Profile = Server.FindObject("Demo Binary Profile");

Profile.Interface.SetVectors(Times, Values);



Disclaimer

Geo SCADA Expert 2019