AddFile

Associated with: DNP3 SCADAPack E outstations and DNP3 SCADAPack Remote E outstations

Security permission required to access this method: Configure

Use this method to add a file to the Geo SCADA Expert database, ready for downloading to a SCADAPack E outstation. Once added, the file becomes available to ViewX users via the Configuration Setup window (see Working with DNP3 SCADAPack E Outstation Configuration Files).

This method is the equivalent of importing a file by using the Add button on the Configuration Setup window (see Add a File to a SCADAPack E Outstation’s Configuration).

Arguments:

Example:

With this example, a Microsoft® JScript program is used to add a file (located on a ViewX client’s D: drive) to the Geo SCADA Expert database. The program uses the AddFile method to add the file to the database.

In this particular case, the method’s SrcFileName argument comprises a three-element one-dimensional array (‘FileInfo’), in order to pass the relevant file details to the server. For more information about the format that this type of array has to take, see the SrcFileName entry above. The second element of the array is used to specify the file’s name (the ‘Name’ property of the ‘File’ object, specified in line 11 below). In this particular case, the same value is also used for the DstFileName (line 15).

Be aware that this example only comprises a brief outline of the type of content that might be included in program that uses the AddFile method. For a more robust application, the program code should also include, for example, any error handling that is deemed to be required.

function AddFile()

{

var fso = new ActiveXObject("Scripting.FileSystemObject");

var File = fso.GetFile("D:\\myfile.rtu");

var BinaryStream = new ActiveXObject("ADODB.Stream");

BinaryStream.Type = 1;// Binary

BinaryStream.Open();

BinaryStream.LoadFromFile(File.Path);

var FileInfo = new Array(3);

FileInfo[0] = BinaryStream.Read();

FileInfo[1] = File.Name;

FileInfo[2] = File.DateLastModified;

BinaryStream.Close();

var Outstation = Server.FindObject("My Outstation");

Outstation.Interface.AddFile(FileInfo, File.Name);

}


Disclaimer

Geo SCADA Expert 2020