RobotStudio event

file search & memory leak help request

h
RouxAxium2010-06-23 19:13:03

Comments

  •    How i can deactivate my handler? 


    Public Sub Activate() Implements
    ABB.Robotics.Tps.Taf.ITpsViewActivation.Activate

            AddHandler
    M_Controller.Rapid.GetRapidData("T_ROB1",
    "AxPers", "bCellAuto").ValueChanged,
    AddressOf AutoColor

        End Sub

     

        Public Sub Deactivate() Implements
    ABB.Robotics.Tps.Taf.ITpsViewActivation.Deactivate

            If Not M_Controller Is Nothing Then

                RemoveHandler
    M_Controller.Rapid.GetRapidData("T_ROB1",
    "AxPers", "bCellAuto").ValueChanged,
    AddressOf AutoColor

            End If

        End
    Sub

  • Hi,

    when you are running a Virtual Controller on your PC the IRC5 Controller file system resides on the PC file system.

    This makes it possible to do things that will not work on an Real Controller.

     

    For example using the .NET System.IO classes you can copy a file from one directory the PC to another directory on the PC which "happens" to be the HOME folder on a Virtual Controller, for example.

     

    The IRC5 controller has one file system, and the FlexPendant Device has another file system.

     

    In order to copy a file from lets say the HOME folder to the FlexPendant Device, where want to do some processing of this file, you must use the FileSystem.

     

    The FileSystem class is actually implemented using FTP, and you can find method like GetFile and PutFile etc. There are also properties that sets the "current directory" on both the FlexPendant and the controller.

     

    Take a look at the chapter Using the FlexPendant SDK - Using the Controller API in the FlexPendant Application Manual (5.13)/RAB Users Guide (5.12).

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog
  • Hi,
     

    is the AutoColor method called even after you have removed the handler?

     

    In that case try to store the RAPID variable that is returned from M_Controller.Rapid.GetRapidData("T_ROB1", "AxPers", "bCellAuto") in a member variable. Then call AddHandler and RemoveHandler on the member. (m_myData = M_Controller.Rapid.GetRapidData(); AddHandler m_myData....)  and check if that helps.

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog

  • No still the same what mean this message?
    image
    RouxAxium2010-06-23 19:13:24
  • Ok i understand my error about the removehandler it was my subroutine didn't have the parameter: (ByVal sender As Object, ByVal e As DataValueChangedEventArgs)

    Regards,
  • Hi,
     

    the HOME directory is part of the IRC5 controller file system, that is why you have to copy files to the FlexPendant in order to be able to access them from your VB.NET code that is executing on the FlexPendant.

     

    I have never tried to use a USB stick on a controller before, but I just tried it out, and the device is automatically mounted and called "/bd0". You can check that with the file explorer on the FlexPendant.

     

    If you want a list of files on the IRC5 file system you shall use the method FileSystem.GetFilesAndDirectories(pattern). This method operates on the "remote directory" which is a directory the IRC5 file system as seen from the FlexPendants point of view, where your VB.NET code is executing. (For example you can specify the USB stick as the remote directory).

     

    If you want to use one of the .jpg files to from your .NET code you have to get it using FileSystem.GetFile(...), which will transfer it to the "local directory" (FlexPendant file system. )

     

    It is pretty common to use the /temp folder on the FlexPendant as the local directory in a situation like this.

     


     

    For example FileSystem.GetFile("/bd0/mypicture.jpg", "mypicture.jpg"), which will transfer mypicture.jpg to the local directory as specified by the FileSystem.LocalDirectory property.

     

    In order to find out which storage devices that are available you can use the FileSystem.StorageDevices property which returns a list of devices.

     

    Best Regards, Niklas Skoglund
    ABB Robotics

    Developer Center
    RobotStudio Blog
  • j
    RouxAxium2010-06-23 19:13:43
  • My list show only the name of the file with .jpg extension in E: and home... so i will like to do the same thing.
  • Ok Done! No more help needed on this subject