09-04-2021 09:27 AM
Hey Guys,
im thinking of the design pattern of my Projekt.
I will have an case structure and using 3 different Com-Ports. But 1 com-port is set for all cases and mostly one of the left is used per case.
Now i learned previously that it is mostly recommended to initialize the Ports in the very beginning before the structure starts.
So the question is know should i initialize them inside the cases, because in this way they are only initialized when they are used and the one for all cases outside?
Should i initialize them all outside of the structure and just pass them through the structure without using them?
Or at least you may recommend another strategy?
Thanks for help and stay healthy
gotti
09-04-2021 10:49 AM
It is impossible to give advice without more information and seeing your code draft.
09-06-2021 04:14 AM
So here is the program attached
09-08-2021 08:57 AM
This entire program seems "inside-out". Why is there no top-level while loop? How is the user supposed to run this? (e.g. once the program starts, operating the tab control has no effect!)
What is the purpose of the tab control? Why is it even connected to a case structure?
What you need is a proper state machine with a loop controlling the UI and possibly multiple loops, each handing one task as needed.
09-08-2021 09:19 AM
Help -> Find examples -> State machine fundamentals