Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Timestamp skipping while direct logging

Hello,

I'm logging data coming on from VISA continuously. I take the data directly, convert it to string together with the measurement time stamp and write it directly into a log. The time stamps seems to skip ~6 minutes about every 6700 measurements. I do not do any timestamp arithmetic, I just take the value, convert it to string and write it to the end of a log file. Any ideas why this could be happening?

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

Hello momar,

 

I would just like to clarify a few things to better answer your question:

First of all, what do you mean by "missing"? Are you also missing data? Does it stop running? Or give random data?

 

Also, do you know if it is timing out? Does it happen around the same time everyday?

 

And finally, how fast are you taking in data? And how large is your entire data set?

Thank you,

Alyssa H.

National Instruments

0 Kudos
Message 2 of 9
(3,736 Views)

Hi Alyssa,

 

Here are a few lines from the data log that uses the get time/date command; the first column is the date, the next is time and the final is PV.

 

5/15/2017,3:57:50 AM,970
5/15/2017,3:57:50 AM,970
5/15/2017,3:57:51 AM,970
5/15/2017,3:57:52 AM,970
5/15/2017,3:57:53 AM,970
5/15/2017,4:03:46 AM,970
5/15/2017,4:03:46 AM,970
5/15/2017,4:03:47 AM,970
5/15/2017,4:03:48 AM,970

 

As you see, there are 5 min, 43 seconds missing between 3:57 and 4:03. Also, there is a way for 1000 msec, but you can see some reading with the same seconds timer.

 

It doesn't seem to be related to the time of the day. It looks more after a given number of log lines has been written (>=6700). I am logging my data every 1000 msec. The data set is directly written to disk after every measurement and the data files typically span 7 hours (~6-10 MB).

 

I log the errors and the error logs are empty. I do not see any time outs.

 

Thanks a lot.

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

Hey momar,

 

That is very interesting. What hardware are you using by the way? And how are you connecting your computer to it (ethernet, usb, etc)?

If you are connecting through Ethernet, do you have any firewalls that may be blocking the connection temporarily?

 

The time stamp is assigned to the data when it reaches your PC. Looking at this, I'm thinking that your hardware may be disconnecting from your computer for a few minutes and then the hardware is buffering a few samples so that when it reconnects, it pushes those samples at the same time. 

 

Regards,

Alyssa H.

National Instruments

 

0 Kudos
Message 4 of 9
(3,719 Views)

Hello Alyssa,

 

I'm using a Dell Latitude E6420 laptop that is always connected to the power line as the Labview running platform. I use RS485 to USB and RS232 to USB, both connected to a stand-alone, line-powered USB hub to communicate with the process equipment every 1000 msec. The logging program is a QSM. The time stamp is generated at the same step the communication is performed with the equipment. The communication is done via the VISA palette, asynchronously. The read commands are written and the data on the bus is read once data is available on the line; the amount of bytes on the line is read and the data is read and interpreted prior to storing it.

 

I cannot rule out buffering, but waiting for 6 minutes seems as a very long time to me. How can I check for that?

 

Thanks a lot.

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

Hey momar,

 

Sorry if I wasn't clear before, but in my previous post I was referring to the fact that your computer may be losing connection with the device altogether for about 6 minutes, not that it was buffering for 6 minutes. 6 minutes is a long time to be disconnected and then to reconnect on it's own. One thing you could check is to see how long you have your Timeout set to. This would make sense if it was set to never timeout, but would not be the case if it was set to timeout after only a few seconds.

 

One thing you could also do would be to create a VI that doesn't collect data from any hardware, and only logs a timestamp and run it at the same time to see if it has the same issue occur.

 

You could also try running this on a different computer if you have one. 

 

I also wanted to ask if you have a service contract with National Instruments (SSP). I'm more than happy to continue helping you on this forum, but if you do have a service contract, you might benefit from creating a service request and working with one of our Applications Engineers on this issue.

0 Kudos
Message 6 of 9
(3,692 Views)

Hi Alyssa,

 

Sorry for being late on this. My timeouts are set to 10 seconds. I did run the logging software that only collects the time stamps and made it run for 3 days in a row. It ran perfectly with no glitches or missed cycles.

 

I'm running this on an academic license. I am not sure if we have a SSP.

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

Hi Alyssa,

 

I still cannot find a reason for the discrepancy and time skipping. The time stamp seems to be working fine now. I put the communications timeout to 1000 msec and I am still facing the same problem. Do you have any recommendations on when should I look next?

 

Thanks,

momar

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

Momar,

 

What hardware are you using? I know that you are communicating through VISA, but what type of connection cable do you have? 

 

One thing you can try to do is to simplify your code as much as possible (until it is basically just VISA collect data and time stamp and log the timestamp only). Then test that and see if the skipping still occurs. Then add other functionality back, such as converting the data to a string, then logging both the data and timestamp together, and see when it starts to skip again.

 

Also, if possible, it may be a good idea to post your code for us to take a look at it.

 

Regards,

Alyssa H.

National Instruments

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