RobotStudio event

Best Solution ?

Hi,
 

Have a small little question. What would be the best solution for this scenario:

 

I have three robots that I will present IO status from on a PC. I will be showing maybe 50-70 io signals in different ways on a form. This I want to update fairly often, at least maybe every 2 - 3 seconds.

 

As I se it I have three ways of doing this:

 

1. Polling the signals every 2 seconds reading them as separate signals.

2.  Polling the signals every 2 seconds but reading them as a filtered signal collection into an array, and then parsing out what I need from the array.

3. Subscribing to each of the signals that i need to watch, then letting one event routine sort out what it was that changed.

 

What of this would be the best solution? And the least load for the system.

 

I guess the subscription way, but I'm not 100% sure.

 

/PerM

 

Comments

  • Hi,
     

    I will say that option 1 is the least effective, since every 2 seconds you will make a big bunch of calls to the controller. Option 3 sounds feasible, but it also depends on how many signals will be monitored at the same time. Regarding option 2, can you map the signals all together? If this is possible, you might me able to define a set of group signals which covers the io signals, then you will only make one signal or one subscription per group signal, at in the PC, you can update things on demand

     

    Hope this helps
    Carlos Martinez
    ABB
  • Hi,
     

    Thanks for the answer.

     

    The signals that I will monitor do not change a lot. They are mostly sensor signals from conveyors and such. Also some signals from safety systems, like open doors, EM-stop buttons and such.

     

    The Group IO way is a good idea. The only problem I can see is that if I need to add a new existing signal, I would need to change the IO declaration in the robot.

     

    When I thought of looking on them as a collection I though of doing something like:

     


    Dim Mysignals As SignalCollection = FormMainWindow.HRController.IOSystem.GetSignals(Input)
    And then look through that list to find my signals. But I'm not sure how much that will load the system.

     

    /PerM

     
  • Hi again Per,
     

    I agree for the group signals, you will need pre-allocate signals or either have virtual signals which are link through cross connections.

     

    About the signal collection, it will generate one call to the controller in order to build the signal. After that, for each of the signal's value, you will make another call to the controller. This part is the one that is "expensive". Then, you will need to get these values again every 2 seconds.

     

    In the scenario you have to add a new signal to the system, will your software automatically recognize this signal?

     

    br/carlos
    Carlos Martinez
    ABB
  • Hi again,
     

    (Long one this answer Smile)

     

    Well, I've been experementing with this a bit now and thought i'd let you know what I've done.

     

    I started by subscribing to the signal that I needed, but this required a lot of "infrastructutute" to handle lists of files to subsribe to. I tried to have lists of the signals in external files that I read in att the application start. It worked but I felt there was a few downsides:

     

    - I felt that I sometimes missed events. This made me still have a slow timed event to round up missed events.

     

    - I felt it was troblesome to unsubscribe and resubscribe to the signals when I switched between the different forms I use.

     

    This made me switch to a polled solution where I read the signals from the thre involved controllers every two seconds with something like below:

    Dim AllMySignals As SignalCollection = FormStartupSelection.HR1Controller.IOSystem.GetSignals(IOFilterTypes.All)

    ReDim IoListaHr1(0)

    For Each MySignal As Signal In AllMySignals

    If Mid(MySignal.Name.ToString, 1, 2) = "di" Or Mid(MySignal.Name.ToString, 1, 2) = "do" Or Mid(MySignal.Name.ToString, 1, 2) = "si" Or Mid(MySignal.Name.ToString, 1, 2) = "so" Then

      ReDim Preserve IoListaHr1(UBound(IoListaHr1) + 1)

      IoListaHr1(UBound(IoListaHr1)).IoNamn = MySignal.Name.ToString

      IoListaHr1(UBound(IoListaHr1)).IoValue = MySignal.Value

    End If

    Next

    Basically What I've done is to make a structure containing the IO name ans value, then read all the signals into this array, one time each poll. I then only work towards this array to evaluate the status.I don't feel that it is slow or anything like that, so i think I will stay with this.

    But maybe you know how it works. Is it one call to the controller for each "For Each MySignal", or is the values already, read?

     






    /Per M
  • In 5.11 there's a UnitSignalChangedEvent where you can the whole bitmap each time a value changes.
    Russell Drown
  • Hi Russ,
     

    Yes that would be nice. But I can't run a 5.11 application, towards a 5.10 controller?

     

    Or can I?

     

    It would be nice Smile

     

    /PerM
  • Here is what it says in the 5.11.01 RAB release notes:

    Note!  PC applications developed with RAB 5.11 require RobotWare version 5.07 or higher on the IRC5 controller. FlexPendant applications developed with RAB 5.11 should be used with RobotWare 5.11.

    <?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />You might want to try this in a test app first to verify that it really does work with older than 5.11. I guess you would want to upgrade your PC runtime environment to 5.11 as well.

    Russell Drown
  • Hi again RussD,
     

    Thanks for the info.

     

    Maybe I will give it a try. I'll let you all know how it went in that cast

     

    /PerM
  • Hi,
     

    The class Unit was introduced in RAB 5.11. Could you upgrade your system?

     

    BR/Carlos
    Carlos Martinez
    ABB
  • Hi Carlos.
     

    I could upgrade my PC to 5.11, but not the robots. So I'm not sure that this new functionality in 5.11, is available in a 5.10 controller. Seeing the post above from RussD, it might be.

     

    If I get some spare time I will try.

     

    Best regards,

     

    PerM
  • you are right .. just give a try before doing the whole UI....   :)

    mvh/Carlos
    Carlos Martinez
    ABB
  • Hi,
     

    This functionality is available in a RW 5.10 controller. Additions were made in PC SDK 5.11 to retrieve existing information.

     
    Best regards,

    Ingela Brorsson
    Software Engineer
    ABB Robotics, Sweden