LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

while loop execution

I have a kinematic equations and I am simulating them on labview. My problem now is that I have a while loop, and I make a shift register, so the result of iteration is returning again to be executed in the my mathematical formula. But that is not exactly what I want, what I need is to take the result of the iteration which is the distance that must be moved by the vehicle in the required direction and then added to the previous value so it is the addition of the current value plus the distance the vehicle has to move and so the new location of the vehicle is known and appeared on the chart that will show the simulation of the movement of the vehcile. So what I need now is to know how to bring the accumelated value and substitute it agin in the mathematical operation which means by mathematics:

 

Xi (which is entered to the shift register)+ X1+X2 until i reaches the last position. I hope u aunderstand my question, I have already read the help of labview but ir didn't aid me. If you have a recomendation for another way to execute my kinematic equations and simulate it on a graph it will be good. For your information my equations of motion are three differential equations one is the velocity in the x-direc., the other in the y-direc. and the last is the rotational speed around z.

what I did is that I take these differential equation and convert them to non differential equation and multiply the right hand side by time step that I decide, and through that i can know the distance that the vehicle has to move in the period of the time step by multiplying this time step by the velocity in the x-direc. for example to obtain the distance to be moved and then add these value to the current location so the new location can be known and these my problem because I must add each distance by the last value so I have an accumelative value and by that the motion of the vehicle can be simulated. 

0 Kudos
Message 1 of 6
(2,587 Views)

This does not really sound like a LabVIEW problem, you simply need to decide what needs to go into the shift register and what you later do with it. You can even use a second shift register where you accumulate certain values for example.

 

Your description is not clear enough to give more detailed advice. Can you attach a small VI example with some diagram comments?

0 Kudos
Message 2 of 6
(2,573 Views)
First of all I see that you are from Canada, I was born in Canada and I have the candian nationality too, I was born in Ottawa!. I attach here a sketch for a simple mathematics operation, what I need is to add the value distance to the initial value of Xc, and then make the subtraction operation and then take distance value and add it to the initial value and to the previous distance value and so on. Until a certain condition will be met and the while loop will stops.
0 Kudos
Message 3 of 6
(2,564 Views)

Sorry, but I am from CAlifornia 😄

 

Please don't attach a 1MB+ bmp file renamed to jpg to fool the forum filter. A png file of your image would be less than 10k.

 

I still don't understand the problem from your description. If you can write it in a sentence, it should be possible to easily wire it up that way. What is Xd?

 

 

Message 4 of 6
(2,553 Views)
if i understand your problem correctly is that u want to add the values of two iterations ...well u can simply add another element with shift register. right click the shift register on the left side of while loop and simply add an element . Read help for shift register you will get the idea.
Regards
0 Kudos
Message 5 of 6
(2,497 Views)
Thanks for you all guys. I was able to find a solution for what I want. And thanks again for your concern.
0 Kudos
Message 6 of 6
(2,465 Views)