terefere 发表于 2022-7-21 20:05:09

if statment who not work?

本帖最后由 terefere 于 2022-7-21 20:05 编辑

I'm bit confused. Line 33 and 34 work's as I think, in array is 0 or 1. But why array have default value =6 if the first or second condition is met?. Sometime I see that array is change only one time to right value?.



If后要接end 发表于 2022-7-22 09:01:01

Try adding the same sentence in the red box

terefere 发表于 2022-7-24 02:32:04

本帖最后由 terefere 于 2022-7-24 03:41 编辑

It's strange for me :)
If I add printf, then array have correct value almost all time. But...
1. Why screen_id get strange value one time?. Timer hit with callback betwen screen change?
2. Why arry show screen id = 1, but Why arry still have 6 instead 5?. "if" statment who change array is before mb_write and after screen_id refresh.
3. at time 20:18:31 you can see that one printf are missing, or... change order with modbus transmision. Why?

If后要接end 发表于 2022-7-25 08:55:39

terefere 发表于 2022-7-24 02:32
It's strange for me
If I add printf, then array have correct value almost all time. But...
1....

1、When the virtual screen obtains the current screen ID, there may be some problems at first. You can download the project to the screen and run it, subject to the actual effect, the virtual screen is just a reference.
2、The second question is similar to the first one, and the virtual screen will be slightly different from the physical one.
3、There is no lack of printf at 20:18:31, but the order of appearance has changed. The command appears first and then the screen id appears, and the screen id is not wrong.
页: [1]
查看完整版本: if statment who not work?