RobotStudio event

Displaying Live Imags

Is there a way to update an image on the TP from a vision system?  I've heard that the yellow robot TP can do this and would love to be able to do this with ABB.  I know how to display one image but its my understanding that the image is enbedded in the .dll.  So can that image be updated without rebooting the TP?
 

Thanks,
Rick Lemberg

Comments

  • Yes this is possible.
     

    In general, you need to copy the image from the vision PC to a known location on the robot flash disk, for example by using FTP, and then implement some mechanism in a FPSDK application to reload the image file in a picturebox control.

     

    There may be limitations with how fast the image can be updated and you may encounter errrors if you try to load the image while an updated version is being written to disk, but in principle it can be done pretty easily.
    Russell Drown
  • Thank You, I'm going to try that, stay tuned :)
     

    Rick
    Rick Lemberg
  • You wouldn't want to use the ResourceManager for loading images, because these images are compiled into a resource file when you build your project, but you will be getting images at runtime from some external source.


    The first thing you need to do is get your image file copied to the robot's flash disk (remote directory), then you need to copy it the the local directory so that it can be loaded into the PictureBox (the ABBPictureBox may be smart enough to accept a RemoteDirectory path, but I have never used it so I don't know).
     

    Finally, you need some method to notify the controller that a new image is present and to reload it. This is easiest to do with an I/O handshake. If you have a vision PC that captures the image, you can write a simple PCSDK application that transfers the image and sets a signal to the controller, which your application can reset when it has loaded the picture.

     

    If you can't do I/O for some reason, then maybe you could do a simple sockets application that handles the request and acknowledge.
    Russell Drown
  • I don't fully understand that last post.  I get that I can't use the tpsresourcemanager but I don't understand what I am to do in its place.  I also understand the copying of the image over, however I am able to write the image to the controller straight from the cognex camera. 
     

    Will I still be using my UpdateImage routine? 

     

    Will I be using something like getfile?  If so would my directory look at "hd0A:/66-59720/"

     

    Please help fill in some of the blanks,

     

    Thanks,
    Rick Lemberg
  • There are several posts elsewhere in the forum that describe this problem and possible solutions like this one. If you search for GetFile or RemoteDirectory you should find others as well.
     

    You need to copy the image file to the FP's local storage for it to be accessible to .Net CF controls like PictureBox. One hint is to always call GetFile with the same destination name to cause the file to be overwritten, otherwise you may use up the very limited local storage of the FlexPendant.

     

    Basically, you just need to set the Image property of the PictureBox to the new image.

     

    For example:

     

    private Bitmap MyImage ;


    public void ShowMyImage(String fileToDisplay)
    {
       // always clean up the old instance

       if (MyImage != null)
       {
          MyImage.Dispose();
       }

       MyImage = new Bitmap(fileToDisplay);
       pictureBox1.Image = (Image) MyImage ;
    }

    You need some way to refresh the image. The most primitive way is to use a timer and just call some method that does "GetFile" and ShowMyImage every n ms. A better way is to have some technique that only refreshes the image when necessary, an I/O handshake is easy and reliable, but it doesn't sound possible in your case.
    Russell Drown