06-12-2012 01:05 PM
Hello,
My problem isn't typical with estimation a time of execution loops. I attached my program. I need to estimate a time vector (depend from the frequency sampling) for graph to "Write to measure file.." function. My program is consist of two while loop. The time of execution is depend from counting samples in Triggers counters.( It's linear to frequency of signal). So the exeution in every single iteration one time is longer and shorter. The internal loop counting the impulses, the external loop is responsible for start and stop the program. I will be thankfull for any helps.
06-12-2012 02:35 PM
Hi,
Not sure what you are asking. Is there a problem with this program?
Or are you interested in making it better?
You are starting with UN-initialized shift registers, that might affect your initial data.
Also, the millisecond timer is "floating", so you never know from one loop to the next loop when the millisecond timer will take data. Use some data flow, like the error line, and put this millisecond timer in a single frame structure with the error line. This will at least make the recording of the millisecond timer occur at the same time each loop.
06-12-2012 02:48 PM
Hello,
I'm interested in making better. The solution in program isn't good. I know.
Could you give me a example How can I make it your suggestions?
Lukasz
06-12-2012 02:59 PM
Hi,
I need to understand what "qualities" would make this program better in order to make code suggestions. As you say, the program works now. You want to make "what part / what feature" better ?
For the timer, surround it with a single frame structure and run some of the data wires through it. This will make it run at roughly the same point in each loop. See attached. This was just a small issue, but it might be important to you, hard to know.
For other suggestions, it really depends on what you think is important as a feature to make more useful suggestions.
06-12-2012 03:51 PM
Can you save as to Labview 2009?. Unfortunaely, I can't open that.
06-13-2012 10:54 AM
LV2009
06-18-2012 02:46 AM
Hello,
Yes:) That's It:). I need only a sum of thats values to get a time vector. Sorry for my absence I was away from computer.
Best Regards,
Lukasz
06-19-2012 09:57 AM
Hello again,
I need some help with your solution. I need to add a every single time of loop iteration beggining from 0 at start.
(for example the first time is 400, the next is 405. I add 400+405=800 and etc with next iteration). I need to plot XY that time as a X and my measurement as a Y.
I will be very thankfull for any idea or solutions. I try with shift register but I got a time from tick counts (the sum from begginning of counts).
Łukasz
07-13-2012 02:28 PM - edited 07-13-2012 02:33 PM
Hi,
You are saying you would like to keep track of the time for the x axis, but not use the "ticks".
Here is a suggestion. Add a timestamp, take the difference each iteration, and use a shift register to add the time up. Here is an example. You might want to start with a different initial time, but this is the basics.
Use the "X+Y" as the time you store each iteration.
The initial time will make your first point always greater than zero.
The wiring is a bit funny, but I use the block diagram clean up, so ....
Attachment is 2009