RobotStudio event

backup event handler

Hello,

  Iam testing an app to create a backup on a remote disc. but Iam having troubles with "backup finished" event handler. Iam using RW 5.10.3007.03. On the virtual system it works ok but on the real system the backup is created but the event is not executed. Can anybody tell me what I do wrong?  My code looks somethink like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

 

Dim BackupDirName As String

Dim BackupDir As String

Dim LocalDir As String

 

Acontroller = New Controller

'adding handler

AddHandler Me.Acontroller.BackupFinished, AddressOf Acontroller_BackupCompleted

'backup name

BackupDirName = "backup1/"

'path

LocalDir = "pc:/"

BackupDir = LocalDir + BackupDirName

Me.Acontroller.Backup(BackupDir)

End Sub

 

Private Sub Acontroller_BackupCompleted(ByVal sender As Object, ByVal e As BackupEventArgs)

TpsLabel1.Text = "Backup ready"

End Sub

 

                        Thanks

Comments

  • Hello,
     

    I think you get the event on the real FP, but the code to update the GUI is not correct.

    Controller events are always received on a background thread. II see in your event handler that you want to make an update of the GUI when you get the  BackupFinished event. To be able to do that you must enforce execution to the GUI thread by the use of Invoke. See how to do this in User's Guide.
    Best regards,

    Ingela Brorsson
    Software Engineer
    ABB Robotics, Sweden