Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Loop for Known Period of Time

Status
Not open for further replies.

DistCoop

Electrical
Jan 2, 2013
83
Hello everyone,

I'm thinking I must be making this too difficult, but I'm not able to figure it out. I have within a function a loop that I want to run continuously for some period of time, and plot the results. I've tried to make a variable t within the loop. At the end of the while loop, I increment variable t by my desired increment (0.005 seconds). I want the loop to run until my variable t has incremented to 2 seconds. It looks like I need to define t as a range variable outside of the function though.

Any thoughts on the way to accomplish this?
 
 http://files.engineering.com/getfile.aspx?folder=24ee5e69-cf3c-4c73-ad0e-7d662581f716&file=Inverter_test.xmcd
Status
Not open for further replies.

Part and Inventory Search

Sponsor