02-29-2016 08:30 PM
It is my first time using LabVIEW and I need some help.
I have made the whole VI but I have problem with the first two loops. In the first loop the moving average should show the random number itself (((random number 1)+0+0)/1). In the second loop (((random number 1)+(random number 2)+0)/2) and after that my VI functions properly. The moving average shows other values in first two loops (ex. random number 17.54, average 29.28). Probably I have to change something in the shift registers but I'm not quite sure how to do that. I need help to correct my VI for the first two loops. Thank you in advance.
Solved! Go to Solution.
02-29-2016 08:59 PM
@blagoj.arsovski wrote:It is my first time using LabVIEW and I need some help.
- I have to design VI that generates random number from 10-100
- VI shows the last generated number and the moving average of the last 3 generated number on a waveform chart
- If the average of the last 3 generated numbers is greater than 55, the LED should switch on.
I have made the whole VI but I have problem with the first two loops. In the first loop the moving average should show the random number itself (((random number 1)+0+0)/1). In the second loop (((random number 1)+(random number 2)+0)/2) and after that my VI functions properly. The moving average shows other values in first two loops (ex. random number 17.54, average 29.28). Probably I have to change something in the shift registers but I'm not quite sure how to do that. I need help to correct my VI for the first two loops. Thank you in advance.
Your indicators cannot update until the loop finishes as you have that code. Simply put them INSIDE the loop so they can update with each iteration. Move the Mait Ms inside the loop too
02-29-2016 09:33 PM
But I need to devide by 1 in the first loop because there is one random number generated and devide by 2 in the second loop because there is another random number generated and added to the first one. In this case the first generated number is devided by 3, then the sum of the first and second is devided by 3 and after that is ok. I should not devide by 3 in the first two loops. The division by 3 starts after the second loop.
02-29-2016 09:39 PM - edited 02-29-2016 10:02 PM
easy
no explin it for the grade
Of course there are other ways
02-29-2016 11:05 PM
Thank you sir. That way is much better.
03-01-2016 10:23 AM
@blagoj.arsovski wrote:Thank you sir. That way is much better.
Now that you got the high grade on the assignment, make sure you understand what the functions are, where you can find them, and how the graph properties are set. Its not "Learning" untill you do understand.