LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combine 4 stops for 4 case structure

Hello everyone!!

I meet a problem in my project, I knwo it's not difficult but we are all beginners for labview.

We need to control 4 batteries, each battery needs a life cycle calculator. I try to connect 4 life cycle calculator(case structure) in my while loop, but there are 4 stops for 4 case structure and 1 stop button for the whole while loop....I don't know how to handle with these four extra case structure stop buttons....

 

As the battery charging and discharging, the life cycle part keep working so actually it's no need for stop button for each case structure , can we just get rid off the stop button for each case structure?? Is there any problem with the life cycle calculator if we do not use the stop button???

 

Really Thank you for help !!!!

 

here I attach our vi, you can configure it directly !!

 

 

0 Kudos
Message 1 of 13
(3,437 Views)

Hi

You could use a local variable if you want to use only one stop button for multiple needs. and Bro ttry to use SubVIs. Yuor program would be more easy to understand. 🙂

0 Kudos
Message 2 of 13
(3,423 Views)

I've done the changes here

0 Kudos
Message 3 of 13
(3,417 Views)

Hey 

 

I just understood. You want the output of those OR gates to go into that stop switch. You can use a compound arithmetic.

0 Kudos
Message 4 of 13
(3,412 Views)

Thank you Thank you!!!

I just remove the stop button, It's also can work!!

0 Kudos
Message 5 of 13
(3,403 Views)

@Mayur_VIenthusiast wrote:

Hey 

 

I just understood. You want the output of those OR gates to go into that stop switch. You can use a compound arithmetic.


you really want to AND the 4 cases once they ALL complete and OR the stop control to exit any time....batteries have unique characteristics: charge and discharge rates, internal resistances, etcetera....so depending on the acquisition from each battery will determine whether to charge or discharge independently. this is not a simple thing to implement. batteries can be overcharged causing heat issues and the breakdown of the materials, shortening life. complex charging/discharging algorithms need to apply depending on the types of battery being used. this is a simple dirty simulation that does not consider the rate of change in a charge/discharge acquisition. this example is like powering a bicycle with a rubber band as opposed to using human muscles or better yet a gas engine...i wonder if you truly considered all the specifications and requirements,? it can be done...but at what cost? could'nt you buy an "off the shelf" $10 charger/discharger...

 

MODsimulateCharger_FP.png

edit: tried to upload the VI and zipping it.... no bueno!

0 Kudos
Message 6 of 13
(3,369 Views)

The main problem is code architecture. Once you fix this, your current problem will vanish automatically. 😄

 

You seem to be spending way too much time rewriting basically the same code over and over. You need to modularize the code and make it scalable. You have four instances of basically the same code. Are you planning to later scale this up for a few hiundred batteries? Would you then simply make it a diagram that is millions of pixels hight? Once you combine all the functionality for one battery into scalable code, you can scale it up for an arbitrary number of instances.

 

Same for the front panel. Make the controls for one battery into a cluster and then make a 2D array of such cluster (2x2 in your case). Suddenly, the entire code will be the size of a postage stamp and easy to maintain. If you currently want to change an error in the algorithm, you need to make identical changes in four different places. If you forget one place, bugs will be very had to find.

0 Kudos
Message 7 of 13
(3,343 Views)

Hi~Apok!!

I just remove the stop button for each case structure. It seems can still working well~

Is that ok?

 

0 Kudos
Message 8 of 13
(3,304 Views)

Sorry I'm a very begineer for LabView I don't know how to combine those functionality for one battery...

 Would you help me?? I attach my VI, could you show me how???

Thank you!!!!

0 Kudos
Message 9 of 13
(3,302 Views)

Hey

 

Dont worry. Everyone has been a beginner sometime or the other. You just have to have to interest to learn new things. I'm posting a link here. you can learn how to make a subVI from there. Its not complicated, just like creating functions in C programming. You have very good instruction manuals in the NI site. all see that. 

 

http://www.ni.com/white-paper/7593/en/

0 Kudos
Message 10 of 13
(3,279 Views)