RobotStudio event

Timer Tick Event

Hello,<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 


Rab Reference files:        5.09.167.0
ROBOTWARE:                 5.09.1020    

 

I have a problem with a simple timer event. I want to use the timer_tick event to update the screen. I enable the timer in the properties menu. The setting will be as showed below.

<?:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />

 

Name:                    TimerUpdate

Enabled:                 True

Generate Member: True

Interval:                    500

Modifiers:        &n bsp;      Friend

 

In the main screen it is usually no problem, but the problems start in a sub screen. The timer in a sub screen has the same settings as in the picture above. If you jump in the sub screen the timer is enabled but does not start the timer_tick event. When I jump to another screen, let say ABB-PRODUCTION and  after opening jump back to the sub screen the timer is started.!!!

 

What can be the problem with the timer tick_event in a sub screen? I spent a lot of time in this problem but it seems to act in a strange way.

 

Thanks,

Comments

  • Do you have a timer for each screen? If so, you can try making the timer Public in your main class and just add an event handler for it in your sub class.

    You might also consider using DataBinding or subscribing to the ValueChanged events to update the controller data items you are displaying on the screen.

    Russell Drown
  • Yes, I have a timer for each screen.

    -Is it not allowed?

    -Why does the event sometimes do not start when I am very sure that I enabled it by startup?

    I tried to follow up your solution to made the timer public in my main class. After I did this, I can not connect the event routine of the timer from the main course in the sub class. It is simply not in the list. (I must say I am also a "Newbie" in VB.Net.

    I hope some other people got the same problem I had with the timer_tick event so I can find the real problem.

  • I have the same problems with updating the screens using a timer tick event image . I also have for every screen a seperate timer.

    For RussD: Do you have a working example of code for making the timer in the main class Public and use an event handler for it in a sub class?

    I think there is somewhere a bug in the ABB software (controller or RAB), but I don't know how to point out the problem area.

    If a subscreen in not update by a timer tick event and I do the following on the Flexpendant:

    <ABB > -> 'Program Data' -> 'Num' -> <Refresh>

    When I return now to my application, the screen which was not updating is working again  image but it will stop sooner of later again image

    It looks like that the flexpendant stops communicating with the robot controller and that it is activated again by pressing the <refresh> button.

    Robware: 5.08/5.09  -  RAB 5.08/5.09

    I have now more then 10 robots which all have the same problem.

    Thanks for a reaction...

     

     

  • kioog
    kioog ✭✭

    hello, i am encountering the same problem.

    it works in the virtual controller in robotstudio, but not on a real flexpendant.

    I need a ticker event in each subclass too.

    Have you an example of how i can make this work?

  • hi guys,

    Scenario:  Having one timer per screen

    1. Can you ensure to enable the Timer by overriden OnLoad

    protected override void OnLoad(EventArgs e)
    {
        timer1.Enabled = true;
        base.OnLoad(e);
    }

    2. Disable the timer by overriding the

    protected override void OnClosed(EventArgs e)
    {
        timer1.Enabled = false;
        base.OnClosed(e);
    }

    3. Dispose the timer in the Dispose event (the designer does not generate code for this)

    4. When opening you sub screen, disable the timer from the main screen; and enable it back when the subscreen closes

    private void TestServicesForm_Click(object sender, EventArgs e)
    {
        TpsForm subForm = new TpsForm();
        subForm.Closed += new EventHandler(subForm_Closed);
        timer1.Enabled = false;
        subForm.ShowMe(this);
    }

    void subForm_Closed(object sender, EventArgs e)
    {
        timer1.Enabled = true;
    }

    If you would like to udpate a graphic control with a RAPID data value, I will do what Russell is proposing .. go for DataBinding

    Saludos/Carlos

     

     

    Carlos Martinez
    ABB
  • kioog
    kioog ✭✭

    i have not been able to test this,but just want to make sure i am getting it right :

    so i have to declare a timer timer1 in each screen.
    i have to insert point 1+2+3 in each screen

    and insert point 4 in the main screen.

    thanks for the quick reply

     

  • kioog
    kioog ✭✭

    just want to add some info:

    i want to use these timer on each screen to show the date and time from the controller for example.

    so in the ticker i put :

    DateTime now = aController.DateTime.ToLocalTime();
    TL_date.Text = now.Date.ToShortDateString() + " " + now.TimeOfDay.ToString();

    is there an easier way to do this?

  • point 4 should be in every screen that is launching a sub screen.

    This guarantees that only the timer of the screen that is shown at the top is enabled.

    Carlos Martinez
    ABB
  • What is important to know is that your timer will poll data from the controller every certain time. I will divide this in two different type of data:

    1 Data that does not change that often. In this case, is better to connect the values either with value changed or DataBinding, so they are updated on demand only.

    2. Data that does change frequently. You might affect the performance of the FlexPendant due to the polling of data. In your example, fetching the controller's time is kind of caothic .. since that changes every time. If this is needed, you will need to deactivate the mechanism whenever your view is not active in the FlexPendant, so the whole Graphics are not affected by polling this data.

    Hope this provides a better explanation

    Carlos Martinez
    ABB
  • so far it worked

    i am really new to this, but i have 1 last question

    i understand the mechanism for text databinding, but if i want to change the backcolor of a control throught databinding how do i do this? for example i want to change the backcolor of a control according to a boolean or to an input from the robot.

    so how to databind another property than text to a control?