Set the new firmare to the conncted drive.
Namespace: EAL.Interfaces.SystemAssembly: EAL (in EAL.dll) Version: 1.1.5.0 (1.1.5.0)
Syntax
C# |
---|
void SetFirmware(
string srcPath
) |
Visual Basic |
---|
Sub SetFirmware (
srcPath As String
) |
Visual C++ |
---|
void SetFirmware(
String^ srcPath
) |
Examples
Synchronous method
| Copy |
---|
private static void Method1()
{
try
{
IEALConnection ealConnection = new EALConnection(false);
ealConnection.Connect("192.168.0.6");
ealConnection.System.FirmwareManagement.OnTransfer += new EAL.Interfaces.System.OnTransferEventHandler(FirmwareManagement_OnTransfer);
ealConnection.System.FirmwareManagement.OnError += new EAL.Interfaces.System.OnErrorEventHandler(FirmwareManagement_OnError);
ealConnection.System.FirmwareManagement.OnFinish += new EAL.Interfaces.System.OnFinishEventHandler(FirmwareManagement_OnFinish);
ealConnection.Motion.Axes[0].SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION);
ealConnection.System.FirmwareManagement.SetFirmware(@"D:\FWA-INDRV_-MPB-17V08-D5.ibf");
ealConnection.System.Reboot();
Console.WriteLine("Rebooted.");
}
catch (FwMngmtEALException ex)
{
Console.WriteLine("Download could not be carried out. Message:" + ex.Message);
}
catch (Exception ex)
{
Console.WriteLine("Un known error. Message:" + ex.Message);
}
}
private static void FirmwareManagement_OnTransfer(object sender, TransferDataEventArgs e)
{
const string msgFormat = "On transfer. BytesTransferred:{0}, BytesTotal:{1}";
string dispMsg = string.Format(msgFormat, e.BytesTransferred, e.BytesTotal);
Console.WriteLine(dispMsg);
}
private static void FirmwareManagement_OnError(object sender, TransferErrorEventArgs e)
{
const string msgFormat = "On error. ErrorCode:{0}, ErrorMessage:{1}";
string dispMsg = string.Format(msgFormat, e.ErrorCode, e.ErrorMessage);
Console.WriteLine(dispMsg);
}
private static void FirmwareManagement_OnFinish(object sender, TransferFinishEventArgs e)
{
const string msgFormat = "On finish. BytesTransferred:{0}";
string dispMsg = string.Format(msgFormat, e.BytesTransferred);
Console.WriteLine(dispMsg);
} |
Asynchronous method
| Copy |
---|
private static void Method1()
{
try
{
IEALConnection ealConnection = new EALConnection(true);
ealConnection.Connect("192.168.0.6");
ealConnection.System.FirmwareManagement.OnTransfer += new EAL.Interfaces.System.OnTransferEventHandler(FirmwareManagement_OnTransfer);
ealConnection.System.FirmwareManagement.OnError += new EAL.Interfaces.System.OnErrorEventHandler(FirmwareManagement_OnError);
ealConnection.System.FirmwareManagement.OnFinish += new EAL.Interfaces.System.OnFinishEventHandler(FirmwareManagement_OnFinish);
IEALConnection ealConnection1 = new EALConnection(true);
ealConnection1.Connect("192.168.0.2");
ealConnection1.System.FirmwareManagement.OnTransfer += new EAL.Interfaces.System.OnTransferEventHandler(FirmwareManagement_OnTransfer);
ealConnection1.System.FirmwareManagement.OnError += new EAL.Interfaces.System.OnErrorEventHandler(FirmwareManagement_OnError);
ealConnection1.System.FirmwareManagement.OnFinish += new EAL.Interfaces.System.OnFinishEventHandler(FirmwareManagement_OnFinish);
ealConnection.Motion.Axes[0].SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION);
ealConnection1.Motion.Axes[0].SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION);
ealConnection.System.FirmwareManagement.SetFirmware(@"D:\FWA-INDRV_-MPB-17V08-D5.ibf");
ealConnection1.System.FirmwareManagement.SetFirmware(@"D:\FWA-INDRV_-MPC-18T01.01-D5.ibf");
ealConnection.WaitUntilQueueComplete();
ealConnection1.WaitUntilQueueComplete();
ealConnection.System.Reboot();
ealConnection1.System.Reboot();
Console.WriteLine("Rebooted.");
ealConnection.WaitUntilQueueComplete();
ealConnection1.WaitUntilQueueComplete();
}
catch (FwMngmtEALException ex)
{
Console.WriteLine("Download could not be carried out. Message:" + ex.Message);
}
catch (Exception ex)
{
Console.WriteLine("Un known error. Message:" + ex.Message);
}
}
private static void FirmwareManagement_OnTransfer(object sender, TransferDataEventArgs e)
{
const string msgFormat = "On transfer. BytesTransferred:{0}, BytesTotal:{1}";
string dispMsg = string.Format(msgFormat, e.BytesTransferred, e.BytesTotal);
Console.WriteLine(dispMsg);
}
private static void FirmwareManagement_OnError(object sender, TransferErrorEventArgs e)
{
const string msgFormat = "On error. ErrorCode:{0}, ErrorMessage:{1}";
string dispMsg = string.Format(msgFormat, e.ErrorCode, e.ErrorMessage);
Console.WriteLine(dispMsg);
}
private static void FirmwareManagement_OnFinish(object sender, TransferFinishEventArgs e)
{
const string msgFormat = "On finish. BytesTransferred:{0}";
string dispMsg = string.Format(msgFormat, e.BytesTransferred);
Console.WriteLine(dispMsg);
} |
See Also