LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to take sum from middle iteration to last iteration?

Solved!
Go to solution

I want to  6 linear differential equations that why i used the simulation method, probably using mathematic palette will be diffucult task. Thanks

0 Kudos
Message 11 of 19
(1,067 Views)

I want to simulate 6 linear differential equations that is why i used simulation loop, probably using mathematic palette will some how be difficult. Thanks

0 Kudos
Message 12 of 19
(1,066 Views)

Hi Abul,

 

Yes, using the Mathematics section of the Functions palette will probably require a little more coding on your end, but you will be able to synchronize your program like you want. I have attached an example here that shows how to solve a simple linear ODE. Hopefully this will help you get started. 

 

Mychal F

Applications Engineer
National Instruments
0 Kudos
Message 13 of 19
(1,051 Views)

I am grateful for all your assistance. I have already synchronized the two loops, using the simulation parameter. I am now only interested in finding the size of the array. I am having 12 rows and 6 columns, pls, what is the size of this array?

0 Kudos
Message 14 of 19
(1,046 Views)

The size of the array is 12x6.

 

As I understand, you want to take the sum of elements [6,0]+[7,0]+[8,0]+[9,0]+[10,0]+[11,0].... and then a separate sum for [6,0]+...[6,11].... and a separate sume for [7,0]+...[7,11].

 

Can you post your most recent version?

0 Kudos
Message 15 of 19
(1,039 Views)

Exactly that is sum the i want to take, attached is the vi. you can stop it when it call iteration the last iteration. Pls, there is also an alternative of stopping the while loop after it call last iteration, would be appreciated. Thanks

Download All
0 Kudos
Message 16 of 19
(1,030 Views)

Hi Abul,

 

By adding a count to your iteration and an OR function, you can stop the VI after it reaches a certain interation or when you hit the Stop button. I have attached a picture of what I am talking about. Hope that helps!

 

Mychal F

Applications Engineer
National Instruments
0 Kudos
Message 17 of 19
(1,019 Views)

Thanks so much. What of finding the size of the array? so that i can take the sum of each variable separately from middle iteration to the last iteration?

0 Kudos
Message 18 of 19
(1,006 Views)

Hi Abul,

 

There is actually a VI called Array Size that will return the size of the array. It can be found on the Functions Palette under Programming->Array->Array Size. It will be the first option. Hope this helps!

 

Mychal F

Applications Engineer
National Instruments
0 Kudos
Message 19 of 19
(997 Views)