LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Design Pattern Case-Structure

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

0 Kudos
Message 1 of 5
(1,564 Views)

It is impossible to give advice without more information and seeing your code draft.

 

  • What do the com ports do? What on the other end of the communication?
  • How can you set a port for all cases? Is that outside the case structure?
  • What does "mostly" mean in this context?
  • If something is on the left, what's on the right?
  • Yes, initialize them outside the toplevel loop.
0 Kudos
Message 2 of 5
(1,550 Views)

So here is the program attached

0 Kudos
Message 3 of 5
(1,493 Views)

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.

0 Kudos
Message 4 of 5
(1,452 Views)

Help -> Find examples -> State machine fundamentals

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 5
(1,446 Views)