Module.Download(MemoryType, InstallMode, String) Method

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Module.Download(MemoryType, InstallMode, String) Method

BR.AN.PviServices .NET


Downloads the module file to the plc. The Address property of the Module and the name of the file (without extension) must be the same. For using a logical name for the Module, it is necessary to set the Address property (Sample2)

[Visual Basic]

Public Overridable Overloads Sub Download( _

  ByVal memoryType As MemoryType, _

  ByVal installMode As InstallMode, _

  ByVal fileName As String _

)

[C#]

public virtual void Download(

  MemoryType memoryType,

  InstallMode installMode,

  string fileName

);

Parameters

memoryType

Destination MemoryType

installMode

Type of InstallMode

fileName

An absolute path for the BR module to transfer

Example

Sample1: Name and Address are the same
// Create new module object
Module moduleObj = new Module(cpuObj,"ab_task");
moduleObj.Download(MemoryType.UserRom,InstallMode.Overload,"C:\\ab_task.br");
// Adding an eventhandler for download progress
moduleObj.DownloadProgress += new ModuleEventHandler(mod_DownloadProgress);
...
...
private void mod_DownloadProgress(object sender, ModuleEventArgs e)
{
    // Setting value property of a progressbar
    this.pgModuleUpload.Value = e.Percentage;
    if ( e.Percentage % 5 == 0 )
        this.lbPercent.Text = e.Percentage.ToString() + "%";
}
Sample2: Using a logical name
// Create new module object
Module moduleObj = new Module(cpuObj,"LogicalName_for_ab_task");
moduleObj.Address = "ab_task"
moduleObj.Download(MemoryType.UserRom,InstallMode.Overload,"C:\\ab_task.br");

See Also

Module Class | BR.AN.PviServices Namespace | Module.Download Overload List


Generated from assembly BR.AN.PviServices [8.1.0.4]