angye Posted July 9, 2015 Report Share Posted July 9, 2015 i want loop timing for while loop. only i want running current time value and just previous time value means before current value. how? Quote Link to comment
Jordan Kuehn Posted July 9, 2015 Report Share Posted July 9, 2015 I'm interpreting that you want to measure how long your loop takes to iterate. See the link below for a simple method for this. Let us know if you are looking to control the timing of the loop or something else. https://decibel.ni.com/content/docs/DOC-11078 Quote Link to comment
angye Posted July 10, 2015 Author Report Share Posted July 10, 2015 thank you for reply, but problem is , i have a camera , this is gives data 30 Hz sampling frequency, means 30fps, means 30 samples per second, time difference between each sample is 1/30 = 0.033 sec. now i want to calculate time difference between each sample as vi run for camera gives data. for that i want previous time of sample and current time of sample . Quote Link to comment
hooovahh Posted July 10, 2015 Report Share Posted July 10, 2015 The previous link seems to do just that, it measures the time it takes for a loop to iterate. But in most situations I'd recommend instead of trying to capture each frame as it comes in, tell it to acquire at 30FPS but then ask to read the frames remaining in the buffer. This way if your loop rate is 200ms that's fine, you'll still get all the frames. There are examples shipped with IMAQ that demonstrate both methods, and even shipped examples to calculate the actual FPS and time between iterations. Quote Link to comment
Jordan Kuehn Posted July 10, 2015 Report Share Posted July 10, 2015 The previous link seems to do just that, it measures the time it takes for a loop to iterate. But in most situations I'd recommend instead of trying to capture each frame as it comes in, tell it to acquire at 30FPS but then ask to read the frames remaining in the buffer. This way if your loop rate is 200ms that's fine, you'll still get all the frames. There are examples shipped with IMAQ that demonstrate both methods, and even shipped examples to calculate the actual FPS and time between iterations. As usual hooovahh is more eloquent than me. Check out "find examples..." under the help menu for some of the referenced content. If you are looking for a quick and dirty FPS calculation my link will do just fine though. Quote Link to comment
angye Posted July 11, 2015 Author Report Share Posted July 11, 2015 The previous link seems to do just that, it measures the time it takes for a loop to iterate. But in most situations I'd recommend instead of trying to capture each frame as it comes in, tell it to acquire at 30FPS but then ask to read the frames remaining in the buffer. This way if your loop rate is 200ms that's fine, you'll still get all the frames. There are examples shipped with IMAQ that demonstrate both methods, and even shipped examples to calculate the actual FPS and time between iterations. can you send me the vi file which your telling Quote Link to comment
hooovahh Posted July 13, 2015 Report Share Posted July 13, 2015 can you send me the vi file which your telling You already have it, launch the example finder Help >> Find Examples and search. Quote Link to comment
angye Posted July 14, 2015 Author Report Share Posted July 14, 2015 i got another way please check file RecordLoopTimes.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.