12-03-2014 05:17 AM
I have a VI where I need to time the value of a boolean which I use a tick counter in ms which is fine. So when the value is 'true', the timer starts and when the value is 'false' the timer stops and using an indicator I can see in (ms) the duration which the boolean was true. not a problem (see attached).
But what I need is that duration time to be recorded to file, txt doc or what ever/spreadsheet not fussed at the min. but it needs to be stored!
Once it has successfully stored the time, I want the timer to reset to 0 ready to time the next value and recored it, but not write over the previuosly stored time.
Hope someone can please help. thanks (the labview expert) nooorrrrrwwwwt
12-03-2014 05:45 AM
12-03-2014 06:36 AM
Thats right Gerd,
I am not sure how to get it to write to a file.
For my duration count, the operation I am using if fine, its simple but does what I need it to do, using two counters adds complexity which is not required. (not for this particular instance anyway)
12-03-2014 08:11 AM - edited 12-03-2014 08:17 AM
*take special note of the mechanical action of the bool switch
12-03-2014 09:13 AM
I always learn something new 🙂 I was not aware of the existance of the "Boolean crossing Pt by Pt" VI 🙂 Very handy tool!
12-03-2014 09:28 AM
Is that photo the entire VI? If so......
Tick Count is not a timing duration tool. I'm not entirely sure, someone can correct me on this, but it either pulls the ms counter from your PC or it's its own internal counter that starts the second you opened LabVIEW. Like I said, someone with more knowledge answer that. Either way, the minute you push run, you're going to get an incredibly ridiculous value that will not make any sense. It'll say something like 54789283 then the next time 64298430. You need a time stamp of when you started subtracted from a time stamp of when you ended.
12-03-2014 09:46 AM
DailyDose wrote: Tick Count is not a timing duration tool....
That's why you subtract the curent from the previous. That will give you the duration you are looking for. It is accurate to the ms. So if that is all the resolution you need, it works wonderfully. If you need more accurate, then use the High Resolution Relative Seconds instead. If your time length is more than seconds, then start looking at using the system timestamp.
12-03-2014 09:51 AM - edited 12-03-2014 10:05 AM
well said cross......
just incase anyone is interested where: \vi.lib\Utility\High Resolution Relative Seconds.vi
12-03-2014 09:57 AM
DailyDose wrote: ... You need a time stamp of when you started subtracted from a time stamp of when you ended.
^^
Yes, you can use Tick count as a time stamp. Never said you couldn't. Just that the code provided is simply a case structure that gets a Tick Count value. Not going to do anything more than that. So I felt the need to explain that Tick Count is not a timing tool unless made to be used as one which apok showed.
12-03-2014 10:17 AM - edited 12-03-2014 10:35 AM
ojk, I have now sorted somewhat, thanks. just need to get it to autostop so it writes the file automatically - at the minute it only writes the values when i press the stop loop button can this be automatically done?