LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with "Wait Until Next Millilsecond Multiple" vi

Hello,
      I'll try to keep this brief and follow up with additional information when necessary.  I'm not using the current software so PLEASE let me know if this has been resolved with the newest version.  I do plan to upgrade but not this month.
      The vi "Wait Until Next Millilsecond Multiple" isn't working as I expect.  Today, if I subtract the millisecond timer value from the real time, I get 10/19/2006  15:13:21.33 (try this yourself - current time -millisecond timer value/1000 = timer origination time). The millisecond timer value output is counting up from there.  Since it doesn't originate from an expected predictable time (appears arbitrary).  I can't use the vi AS-IS and get my vi to repeat at a predictable interval.  If I use 1000 for the input, I expect the timer to end at every whole second in time.  However, it ends at about 0.33 seconds later.  If I use 60,000 for the input, I expect the timer to end at every whole minute in time.  However, it ends at 21.33 seconds after the whole minute mark.  My timer appears to be losing time but I can confirm that tomorrow by comparing data.  I could create a vi to do the same function but I would like to know if there is a fix for this first.
      I have a running vi to back this up and I will post that and other examples if necessary.  
 
Please Advise,  Scott
0 Kudos
Message 1 of 2
(2,472 Views)

Hello,

      My mistake.  The vi was intended this way.  When I read the help information on "Wait Until Next Millilsecond Multiple" it did NOT include the information about the "Tick Count (ms)" because I don't really use it.  It states "Returns the value of the millisecond timer. The base reference time (millisecond zero) is undefined. That is, you cannot convert millisecond timer value to a real-world time or date. Be careful when you use this function in comparisons because the value of the millisecond timer wraps from (2ˆ32)1 to 0." 

      So there's no bug here but I do believe that there should be a similar function that would generate the millisecond multiple to be a multiple of real time.  So, if you input 60,000 the timer would end at the end of every minute.  I really don't see why the base reference time is undefined.  LabView can give me the real time.  I would guess that LabView could restart the millisecond timer at the start of every day.  This would certainly add value to the vi.

      I do want to mention that I've read other threads where people believe that the millisecond timer value is based on real time and they have inadvertantly advised others accordingly.

      I'll just make my own function for now.  I'll just use "Get Date/Time in Seconds", calculate the time to wait from the multiple, and divide it into 100 pieces or more (depending on resolution desired) and loop that many times or until the desired time has passed (rechecking time at each loop).

Thanks, Scott

0 Kudos
Message 2 of 2
(2,461 Views)