LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

estimation a time (loops executions) for measurement ( write to measure file)

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. 

0 Kudos
Message 1 of 9
(3,086 Views)

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.

 

 

-------
Mark Ramsdale
-------
0 Kudos
Message 2 of 9
(3,079 Views)

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

0 Kudos
Message 3 of 9
(3,074 Views)

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. 

-------
Mark Ramsdale
-------
0 Kudos
Message 4 of 9
(3,068 Views)

Can you save as to Labview 2009?. Unfortunaely, I can't open that.

0 Kudos
Message 5 of 9
(3,062 Views)

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

0 Kudos
Message 7 of 9
(3,025 Views)

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 

0 Kudos
Message 8 of 9
(3,003 Views)

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.

 

timestampfeedback.png

 

 

The wiring is a bit funny, but I use the block diagram clean up, so .... Smiley Surprised

 

 

Attachment is 2009

-------
Mark Ramsdale
-------
0 Kudos
Message 9 of 9
(2,978 Views)