Faking an RS232 Serial Port I have an application that reads data from serial port. To test the application i would like to create a virtual serial port that generates data and puts the the port at the same PC, so that the other app can access that data.
A question for the vb.net GURU(s) out there. Is there a way I can create a virtual serial port in vb.net in code.
Basically I want to be able to read what is being written to a com port (which will be the virtual port) reformat what is being written and send it out another com port. This is of course without buying external software or using a driver for this.
I've been searching around alot over the internet but could only find external software to do this. Has anyone done this before? Thanks in advance. The loopback is possible but the only issue is that you will still need to use another serial port to send the reformatted information to another device. Which means two com ports are used instead of just one.
Com1 transmits to com2, com2 transmits to device. But unfortunately the plan was to read data being sent out one com port (the virtual port that I'm wanting to learn how to create). Read the data being sent out the virtual port(this may need looping back).
Reformat the data and send the reformatted data out a physical com port. If this is possible then I will be able to use only one com port. Any one done this sort of thing before? • → *new* Get practical advice and learn best practices for moving your applications from RDBMS to the Couchbase Engagement Database.
(sponsored) • → Learn to shorten database dev cycles, integrate code quality reviews into Continuous Integration workflow, and deliver code 40% faster. (sponsored) • → See a demo showing how you can build a globally distributed, planet-scale apps in minutes with Azure Cosmos DB. (sponsored webinar) • → A complete overview of Cloud Computing focused on what you need to know, from selecting a platform to choosing a cloud vendor. • → Better understand the signs that your business has outgrown its current database. (sponsored webinar). Click Here to Expand Forum to Full Width.
What do you need to simulate? The communication with an external device which is not present during the tests?
- First find out which functions and properties of SerialPort you really need (in our case, we just needed a few of them). - Create an interface defining them. - Create a wrapper for the 'real' port which implements your interface. That will be the instance used in production.
- Make your other code depend on your interface instead of the 'real' port. - Create a dummy port which implements your interface, and add the logic for emulating the device. That's the instance used for testing.
- You may create further dummies which simulate communication problems - now you can test that your code copes with that, too. When answering a question please: • Read the question carefully. • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Program bantuan penelitian tesis dan sastra.
Insults are not welcome. • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
Faking an RS232 Serial Port I have an application that reads data from serial port. To test the application i would like to create a virtual serial port that generates data and puts the the port at the same PC, so that the other app can access that data.
A question for the vb.net GURU(s) out there. Is there a way I can create a virtual serial port in vb.net in code.
Basically I want to be able to read what is being written to a com port (which will be the virtual port) reformat what is being written and send it out another com port. This is of course without buying external software or using a driver for this.
I've been searching around alot over the internet but could only find external software to do this. Has anyone done this before? Thanks in advance. The loopback is possible but the only issue is that you will still need to use another serial port to send the reformatted information to another device. Which means two com ports are used instead of just one.
Com1 transmits to com2, com2 transmits to device. But unfortunately the plan was to read data being sent out one com port (the virtual port that I'm wanting to learn how to create). Read the data being sent out the virtual port(this may need looping back).
Reformat the data and send the reformatted data out a physical com port. If this is possible then I will be able to use only one com port. Any one done this sort of thing before? • → *new* Get practical advice and learn best practices for moving your applications from RDBMS to the Couchbase Engagement Database.
(sponsored) • → Learn to shorten database dev cycles, integrate code quality reviews into Continuous Integration workflow, and deliver code 40% faster. (sponsored) • → See a demo showing how you can build a globally distributed, planet-scale apps in minutes with Azure Cosmos DB. (sponsored webinar) • → A complete overview of Cloud Computing focused on what you need to know, from selecting a platform to choosing a cloud vendor. • → Better understand the signs that your business has outgrown its current database. (sponsored webinar). Click Here to Expand Forum to Full Width.
What do you need to simulate? The communication with an external device which is not present during the tests?
- First find out which functions and properties of SerialPort you really need (in our case, we just needed a few of them). - Create an interface defining them. - Create a wrapper for the 'real' port which implements your interface. That will be the instance used in production.
- Make your other code depend on your interface instead of the 'real' port. - Create a dummy port which implements your interface, and add the logic for emulating the device. That's the instance used for testing.
- You may create further dummies which simulate communication problems - now you can test that your code copes with that, too. When answering a question please: • Read the question carefully. • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Program bantuan penelitian tesis dan sastra.
Insults are not welcome. • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.