Timer Problem: Cannot find component: Time

I have block like this

for the first load (when I open the screen) its running well, after I move to the other screen and go back to previous screen, this error always show

here is the error
Screenshot 2025-10-27 115437

I read several post with the same problem, when I follow the instructions I still got that error.

This my .aia file
qrs.aia (2.0 MB)

NOTE:
This problem occur when you hit the menu in dashboard screen to another screen and go back using arrow back in top - left.

Dear @digischool_digitalen, as many other components, like BT comm's, or global variables, cease to work when switching between screens. Please consider that switching between screens is like running a completely different app. To avoid this we often suggest to use "virtual screens" instead (if you dig the forum with such tag you'll find many similar topics).
Moreover, there is a FAQ section (thanks to @ABG) that teaches how to correctly switch between screens.

Best wishes.

1 Like

Try something like this:

image

Best practice to stop the clock when leaving a screen.

1 Like

Dear @digischool_digitalen ,
reading the answer from @TIMAI2, I've seen that you've allocated the initialization of clock1 in its clock1.timer event itself..
That's not correct. At design level you'd better untick both checkboxes: timer.enabled and timer.alwaysfires (so to avoid any unwanted clock1.timer event at the start of your app).
You shall then initialize it in a separate block, like suggested, for example in screen1.initialize, so when returning back form another screen, the clock is reinitialized as well.
And do not forget to stop it when leaving screen 1 (as per @TIMAI2 suggestion).
But, as in my previous post, if you can allocate all your code into screen1 and you use virtual screens, you can leave all the troubles behind your shoulders... :grin:

I follow your instruction, I still got this

designer level, I've unticked both of timer and always fire options

even it was my best practice to handle several screens, but I have bad spec for my device, thank for your advice anyway

Unfortunately from the error message it is not clear which of the two labels of screen1 is causing the runtime issue. If the error is caused by the second one, which lays in a not visible vertical arrangment, when you switch back from a secondary screen to screen1, probably what is inside that arrangment (va_register) is not available/recognized any longer.. :thinking:
image
To detect which one of the two labels is the cause, you can comment out (disable) the relevant instruction row (for example to eliminate the first label, you can do):


and see what happens.
Or, you can comment out the second label, and see if the error disappears.

I tried to solve in dashboard screen not in screen1. Since I still in dashboard screen, I am not sure, that problem come from screen1.

Before switching screens, stop all clocks
Taifun

I did

Sorry, I don't understand: you're still in dashboard screen and you try to set a label that is in screen1 ? That will not work.

Here ?

So this clock1 isn't the same clock1 of screen1 but the clock1 of the dashboard screen ?
You have the same name for variables and clocks for the two screens (screen1 and dashboard). Have you tried to use different names for clocks and variables ?(unless those variables passed through screens by means of TinyDB, as you do).

I do not see you stopping the clock here

Also learn to switch screens correctly

Taifun

Thank you very much this problem is solved. Thank you so much @Taifun,

but, its come again :cry:

Switch screens correctly!
Taifun

1 Like

As also @TIMAI2 has initially said, you shall stop any clock running in any screen"X" before leaving it, otherwise the clock runs anyway, and when attempting to access to a component (like a label) belonging to a screen not active in that moment, it will issue the error.

finally what all of you told me, it was true, and now the problem is solved!.
thank you everyone @TIMAI2 @Taifun @uskiara you are great!