LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

optimal structure?

optimal structure.
I am structuring my project with the following loops and case structures. I am following a good method? are good practices?Estructura scada.jpg

Es un placer echar una mano siempre( Base de una sana convivencia). Si mi respuesta te sirve por favor agradecemelo con un Kudo 🙂
Un especial saludo a mis hermanos latinos. Un mundo mejor es posible.
0 Kudos
Message 1 of 10
(3,124 Views)

Hey,

 

try to avoid deep nested structures. Please avoid the usage of a While loop in  a While loop in  a while loops.....

 

If you open LabVIEW -> welcome window -> create Project

 

take a look at the state machine template or the other architectures already implemented. I guess this would be a good starting point for a good structure..

 

Regards,

CMW..

0 Kudos
Message 2 of 10
(3,110 Views)

Not at all. Please go to the Project templates available in LabVIEW and also search for "Design Patterns" in LabVIEW, you will get some good designs to start with your project. You also have tutorials which will guide in using the design patterns according to your requirement.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 10
(3,101 Views)

I would also say you likely want to go with a State Machine.

 

You also might want to break up some of your code into modules.  For instance, you could have a loop just for controlling your motor with another handling your state machine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 10
(3,070 Views)

Thanks for resquest.

 

All that programming structure is because I'm setting the filling and draining three tanks of fuel controlled SCADA. To control this work the state machine would you use?
The programming is finished and the way I said above and it works fine. But this was only the first test and now I want to make it perfect so that no errors occur.

 

Regards

Es un placer echar una mano siempre( Base de una sana convivencia). Si mi respuesta te sirve por favor agradecemelo con un Kudo 🙂
Un especial saludo a mis hermanos latinos. Un mundo mejor es posible.
0 Kudos
Message 5 of 10
(3,026 Views)
Yes, this application would be well suited for a state machine. Given the added information you provided -- that there are 3 tanks -- I would start by developing a reentrant VI capable of controlling one tank, and at runtime launch a copy of it for each tank.

The problem with having everything in one big VI is that a problem with one tank could adversely effect all three.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 10
(2,984 Views)

@mikeporter wrote:
Yes, this application would be well suited for a state machine. Given the added information you provided -- that there are 3 tanks -- I would start by developing a reentrant VI capable of controlling one tank, and at runtime launch a copy of it for each tank.

The problem with having everything in one big VI is that a problem with one tank could adversely effect all three.

Mike...

For instance, if one tank developed a problem where it got stuck, all the other tanks would never get serviced by the VI... and you can just imagine all sorts of bad things happening because of that...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 10
(2,943 Views)

Thank you. For the problem of the tanks. Two of the tanks discharge on another. Do not know if this affects. I do not think so. If I try to modify the code as soon as possible. But after all the work done do not know if I will have problems where none now.
A greeting.

Es un placer echar una mano siempre( Base de una sana convivencia). Si mi respuesta te sirve por favor agradecemelo con un Kudo 🙂
Un especial saludo a mis hermanos latinos. Un mundo mejor es posible.
0 Kudos
Message 8 of 10
(2,909 Views)

Hey,

 

So you stick to your original architecture?

 

"But after all the work done...." -> think about the sunk-cost fallacy and modify your architecture 🙂

 

s idea of making the VI reentrant sounds good and also the statemachine should fit your application.

Who knows which problems will arise;  what happens when you need an additional tank; ...

 

Regards

CMW...

0 Kudos
Message 9 of 10
(2,899 Views)

After thinking it over and discuss it with my partner if I will modify my structure as a state machine.

 

Thanks for all your advice. 

Es un placer echar una mano siempre( Base de una sana convivencia). Si mi respuesta te sirve por favor agradecemelo con un Kudo 🙂
Un especial saludo a mis hermanos latinos. Un mundo mejor es posible.
0 Kudos
Message 10 of 10
(2,886 Views)