Hello I am using the display to show six different voltagelevels provided by raspberry over UART.
I send each voltage level as a variable into the HMI then I use a Timer function to update the display as a use a Gauge and Pictures as Numerical display (because Fonts are so uggly).
This setup is not very fast even I have already increased the UART Baudrate.
I suppose the problem is that I transport all the variables in separate messages. Have anyone a good Idea how to speed this up?
I dont found a built in function to crop variables (e.g. use a transport string containing all variables) or to use a kind off array...
Fonts are limited to monobit 1/2 width of height fixed width at the moment.
There is no font anti-aliaising or font smoothing
However a font editor may assist, it will certainly reduce file size
(I may be biased to my ZI Font Editor, but there are others as well)
Check Tools,Tips Tricks and How-TOs thread in Gallery
Timer is tricky, it be overloaded. 50ms can occur in sequential sequence 1400ms out - but this depends on how well you overload it. Model makes a small difference in figuring out what resources are available to assist in optimizing. Font .txt and .val needs to adjust per your situation to steal back cycles Turn wordwrap off, adjust alignments to use less branches, change .w and .h to use less pixels.
Knowning the ranges of all 6 timers maybe can reduce transport, and samples rates a definite need to know
My timer update is complex I think its too much data to send when I do it in raspberry:
Nextion is interpreted code, so timing is all about pixel counts and bit timing. A 50ms timer has already limited to a max of 20 (or more often ~19.5 timer triggers per second).
Is you sample rate actually 20 times per second, are you sending these 6 values over serial ever 50ms, or is the timer needed only to process this routine.
Disclaimer - I am guessing at 50ms timer - you never truly stated that.
Model is ??/ Basic or Enhanced? Model Size ?
Without testing all the actual code and debugging this code (not fan of)
I am only able to give roughly things for you to make considerations of.
I am not a fan of using timers to check for changes and act if changed.
Rather, I would use a hotspot to place code in when changes are made
click m0,1 // code to make change is in Hotspot m0 press event
This way when the change is made, you trigger the code needed to
update the screen and reflect the current state. This is more proactive
rather than constantly polling to check if a change has been made.
Only when your value changes, do you need to execute and most
executions will most likely be in under that 50ms minimum timer.
No need for a timer that can interfere in other code