LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Take time between two max values

Solved!
Go to solution

Start by removing the for-loop. It always runs once, so i is always 0.

 

Example_VI.png

0 Kudos
Message 41 of 62
(652 Views)

Yes the problem is the foor loop but If i remove the first for loop...i have to make the same estructure but using the while loop? or how?

 

 

I understand your example from this I see what happens the itineration is always 0 in mine like in your picture

0 Kudos
Message 42 of 62
(643 Views)

In post #14 I played around with using a scalar instead of the array. Was that post helpful?

http://forums.ni.com/t5/LabVIEW/Take-time-between-two-max-values/m-p/2647305#M789967

0 Kudos
Message 43 of 62
(638 Views)

Tood..no it didn't work :S

 

the program that it works good is from Uday this that I add but when I put this in my program it doesn't work for the first for loop for the itinerations.. :S

0 Kudos
Message 44 of 62
(635 Views)
Hi jocuma,

-Do you want to get peak time diff inside while loop? I guess in your code it may not because you don't have all the samples.
-When i asked you gave 2d array/samples in xls sheet. From which i coded the program.
-How about keeping my code outside your while loop and send 2d array to it and see if it works, because there you have full data with which/how i created code?

Thanks todd for noticing 1sample thing 😛
Thanks
uday
0 Kudos
Message 45 of 62
(623 Views)

Yes is one of the problems... I think it could be a good idea keeping your code outside the while lop and send 2d array when I press the button stop,

 

it could be a good idea no?

 

But when you say outside in which part I have to put? And how I have to send the 2d array? :S

 

thanks tood and uday 

0 Kudos
Message 46 of 62
(621 Views)
Hi jocuma, i think that is good to try here.
-After your while loop, you are having case structure which writes samples to file right?
I suggest you keep my code there. or after that also no problem.
-Do you have my Min-Max_Peak_1.vi? in that i am taking 2d array of data isn't it, instead of that you send your samples data and check if it works.
Thanks
uday
0 Kudos
Message 47 of 62
(619 Views)

I put out of while loop but it doesn't work....its something like this? :S

0 Kudos
Message 48 of 62
(614 Views)
Hi jocuma,
-If you do like this, you might end up getting no data in "Dades" because of race condition.
-First pass the error wire coming out of while loop to this property node(To make sure it executes after while loop)
-Please check now first are you getting "Dades" properly??
-Then check 2d Temp and voltage indicator and then check before and after first for loop and so on.
Thanks
uday
0 Kudos
Message 49 of 62
(609 Views)

I ve done something like this but always appears 0 0 0 0 in the 2d temp and volt

 

is it what you say?

 

sorry for my english....

 

thanks a lot

0 Kudos
Message 50 of 62
(608 Views)