473,657 Members | 2,283 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can i add Time stamp for serial port for sending data and receiving

1 New Member
I am able to Transfer data and files over serial port in c# , but the problem is i have to send the file in 500 ms can anyone suggest me how to send the file within time period and how to add time stamp

here my code for sending files
Expand|Select|Wrap|Line Numbers
  1.    private void butSendFile_Click(object sender, EventArgs e)
  2.         {
  3.             if (serialPort1.IsOpen == false)
  4.             {
  5.                 this.serialPort1.Open();
  6.             }
  7.             serialPort1.Write(System.IO.File.ReadAllText(this.txtfile.Text));
  8.         }
  9.  
  10.         private void butSetFile_Click(object sender, EventArgs e)
  11.         {
  12.  
  13.             OpenFileDialog ofd = new OpenFileDialog();
  14.             if (ofd.ShowDialog() == DialogResult.OK)
  15.             {
  16.                 txtfile.Text = ofd.FileName;
  17.             }
  18.         }
Feb 15 '17 #1
0 2366

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

Similar topics

4
9086
by: ^CeFoS^ | last post by:
Hello to everybody, I've done an application that draws in a frame the trajectory of a robot. The robot position is readed through the serial port, and several commands are wrote through the same port to change the direction of the robot. The trajectory frame is managed by an applet, and the project works good when the applet is called by a html document allocated in the same local machine under W98 where the classes and the serial port...
2
3461
by: Padu | last post by:
Hi, I know that the System.IO.Ports.Serial port event for receiving data (DataReceived) happens on a secondary thread, and that if there will be any interaction of that data with the UI, it should be done through invoke. Right now my application receives serial data and a class hierarchy is responsible for handling it. If I run the application, everything seems to work fine, but if I put a breakpoint on it and try to follow, the...
6
2527
by: vipulagarwal.in | last post by:
hi i hav written a code in python to send an SMS from a nokia 3310 connected to my PC... i wanted to receive a msg on my PC. In order to do so, the PC must know when it has to read data frm the serial port ...thus an interrupt must be generated when the serial port receives data frm the phone .....HOW CAN I DO THIS IN PYTHON ?? can anyone help me with this INTERRUPT HANDLING thing in PYTHON ??? thanks
15
8184
by: xkenneth | last post by:
Hi, I'm writing a couple python applications that use the serial port (RS-232) quite extensively. Is there any way I can monitor all activity on the serial port and have it printed as the transactions occur? I'm trying to reverse engineer a microcontroller serial routine and I'd like to see any response the chip sends back. Regards, Ken
7
5387
by: davetelling | last post by:
I'm a newbie that is still struggling with OOP concepts & how to make things work they way I want. Using Visual C# Express, I have a form in which I added a user control to display a graph, based upon data received via the serial port. If I run the serial port in the main form code, I can get data and, using public properties of the user control, transfer the data to be shown on the graph. However, I am trying to add a feature that will...
2
4309
by: pauland80 | last post by:
Hello, My soft passively listen to a device sending +- 300 bytes of data each second. After several hours of work, the soft abruptly stops receiving data without any error, (while the device sends properly, of course) and I need to restart it (the python soft) to "reactivate" the ports. I read that when the serial port encounters an error (frame error or so, I imagine?) it stop receiving data until the library function...
1
2006
by: vtang | last post by:
Is there a way using PL/SQL script to update the time stamp of a CLOB data in a table? Basically we can download the CLOB file to local and update the content with new time stamp.
1
5770
by: sdbranum | last post by:
For those who have found it impossible to get help in communicating with Wasp's WDT-2200 Barcode Scanner through a COM Port, except by using their supplied DTComm software, I am presenting what I have found through use of a Protocol Analyzer connected to the COM port, and how I have managed to upload (from Scanner to Computer) a file holding transactions recorded by others using the scanner to "Issue Parts". Quickly though, allow me to note...
0
1503
by: neelsfer | last post by:
Has anybody perhaps have code to check the serialport of the PC(rs232) for data received from a a rfid scanner, and if its available, then populate it to a textbox on a form. i currently use 3rd party logger software but it is not very stable. The hex characters received through a serial port are converted into numbers and then transmits these numbers to the app as keystrokes. i.e 0004, or 0005, etc. followed by a comma and "ENTER". i use...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.