Use the serial port simulation tool for serial port Program Development and debugging

Source: Internet
Author: User

This article is original from Xiao Li's column and needs to be reproduced with the source: [http://blog.csdn.net/softwave/article/details/8907599]

Recently, I am working on a project that requires the use of Java to read the small data of the pound tower. This requires the use of Java to communicate with the serial port. Serial Port Java code has been developed, but it cannot always debug programs at the production site. Therefore, it is imperative to simulate serial port data on your laptop. Fook of Google found two gadgets: VSPD and serial port debugging assistant. The following describes how to debug the serial port program by combining the two gadgets.

1. After installing VSPD, first select the virtual port number and click "add Port ". Generally, no serial ports are available on the current laptop, so you can choose COM1 and COM2.

2. After the port is virtualized, the new virtual COM1 and COM2 are displayed on the left. At this time, both ports are not occupied and are in disabled status.

3. Open the serial port debugging assistant and set parameters such as the baud rate, parity bit, data bit, and stop bit of COM1. Make sure that COM2 is not in use. We set this to enable COM1 to send data, and COM2 to receive data. If COM2 is also occupied, your program will not be able to use this port.

4. Fill in the box in the figure with the data you want to simulate and click "auto send". Then you should see that the progress bar keeps moving forward, while the Sent data of VSPD COM1 keeps growing, this indicates that the serial port debugging assistant is continuously sending data through com1.

5. Open the program you want to debug, set the baud rate and other parameters in your program, and you will see the simulation results. In this case, we can see that COM2 in VSPD is occupied by Java, and the amount of written ed data continues to grow.

This article is original from Xiao Li's column and needs to be reproduced with the source: [http://blog.csdn.net/softwave/article/details/8907599]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.