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.
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.
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.
-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.
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.
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.
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?