02-22-2018 01:11 AM
Hi irsa,
whenever I press "Reset" the "Time has Elapsed" goes to TRUE for exactly 3s:
Can you verify this?
This would be step 1: verifying the correct working of the ElapsedTime part to generate a signal being TRUE for the time of your measurement.
In step 2 you need to check if the data saving works as expected. Did you talk with Jawad on this topic?
02-22-2018 02:25 AM
With your guidance we are almost near to solve this issue. I verified both the steps for the code attached to this post. Whenever i press "record" it saves for next "6" sec. The only issue now is that alongwith saving those 6 sec, it always save first 5.4 sec data when we press "run" button. I just want to get rid of these almost 5.4 sec data now.
02-22-2018 02:31 AM
Hi irsa,
The only issue now is that alongwith saving those 6 sec, it always save first 5.4 sec data when we press "run" button.
This is "by design"…
ElapsedTime will start with "time is not elapsed" after each start of the VI.
You need to program a logic to avoid saving data in the first 6s after run!
Hint:
run time := current time - start time
IF run time < 6s THEN
don't save
ELSE
use ElapsedTime condition
ENDIF
02-22-2018 04:24 AM
I have created a logic in code but dont know how to give current time and start time as input to case structure used as if else condition.And secondly how to place this condition/case structure in the code. Is it positioned at correct place , i mean outside the loop?The code is attached....
02-22-2018 04:29 AM
Can you please convert the logic (given in your last post) to LV code. I am trying but couldnot get it properly.
02-22-2018 04:48 AM
Hi irsa,
I am trying but couldnot get it properly.
You have a huge problem with THINK DATAFLOW!
Why do you put code, which needs to be executed in your loop, AFTER the loop?
Why do you use controls instead of reading system time?
Simple solution:
02-22-2018 07:55 PM
Its done perfectly 🙂 Thank you so much