473,378 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Timestamp within sec. accuracy

Hi..

Need a timestamp for data coming in for a serial port within second accuracy.How can i achieve this??
Nov 5 '06 #1
1 1100
albertw
267 100+
Hi..

Need a timestamp for data coming in for a serial port within second accuracy.How can i achieve this??
hi

maybe you can put the systemtime before the incoming data?

Expand|Select|Wrap|Line Numbers
  1.  
  2. With MSComm1
  3.     .InputLen = 1
  4.     .RThreshold = 0
  5.     .SThreshold = 0
  6.     .InBufferSize = 10240
  7.     .InputMode = comInputModeText
  8.     .Handshaking = 0
  9. End With
  10.  
  11. sub where you receive your data from rs232...
  12.  
  13. Do
  14.     RxTxt = MSComm1.Input
  15. Loop Until RxTxt > vbNullString
  16.  
  17. inBuffer=vbNullString
  18. Do
  19.     DoEvents
  20.     RxTxt = MSComm1.Input
  21.     If Len(RxTxt) > 0 Then 
  22.         If inBuffer = vbNullString then inBuffer = Format (Time,"hh:mm:ss") & chr(10)    
  23.      inBuffer = inBuffer + RxTxt
  24.     End If
  25. Loop Until RxTxt = vbNullstring 'or any character to end the session
  26.  
  27.  
Nov 5 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Robin Tucker | last post by:
Hi, I'm in the process of implementing a multi-user system containing an adjacency list (tree structure). I'm using a TIMESTAMP field on each record in the adjacency list in order to tell when...
1
by: Roberto Nenni | last post by:
hi all and sorry for my english I write into a SqlServer2000 database via jdbc using a PreparedStatement (pstmt) and one of fields is a TimeStamp, my code is: qwdum=System.currentTimeMillis();...
1
by: James Scott | last post by:
Hello, I was wondering if there is a package out there, that allows to convert a date into an int-Timestamp (accuracy needed: 1 sec) and maybe provides some basis time calculations. ...
67
by: James Harris | last post by:
I have a requirement to store timestamps in a database. Simple enough you might think but finding a suitably general format is not easy. The specifics are 1) subsecond resolution - milliseconds...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.