Com0com, Null-modem emulator, also includes COM to TCP redirection. The Null-modem emulator can be used to provide serial interface for COM port redirectors. For example, with the com2tcp ( COM port to TCP redirector, part of the com0com project ) you can communicate via serial interface with the TCP/IP servers. Free Virtual Serial Ports is a Windows user-mode application, which allows you to create software virtual serial ports and emulate physical serial ports behavior. It operates exclusively in user-mode, therefore it is more stable and uses less memory, processor and operating system resources than any competitive products.
Active1 year, 2 months ago
I'm about to start developing a small app (C#) that communicates with a PLC and a testing unit via Serial Ports - this is my first venture into this area.
Popular Alternatives to Virtual Serial Ports Emulator for Windows, Software as a Service (SaaS), Mac, Linux, Web and more. Explore apps like Virtual Serial Ports Emulator, all suggested and ranked by the AlternativeTo user community.
In essence, I am going to send the PLC a signal to start an operation, and then I am going to wait for the result of that operation from the test unit (which will be independently communicating with the PLC) to return a ASCII string.
Depending on the content of that string, I may want to listen to a signal from the PLC..
Virtual Serial Ports Emulator is designed to solve compatibility issues with older applications and help you create and use several serial ports at the same time, without having to install. Learn how to create a virtual serial port (virtual COM port) to modernize and extend the life of legacy assets. Works for PC without DB9!
It's all new to me, so at the moment, I'm just researching System.IO.Ports.SerialPort; digression: are there third part products out there than simplify interaction with the Serial Port, or are the built-in classes as good as you will get? I'm thinking of ease of use as opposed to better features.
However, it will be a few weeks before the hardware is available for development and testing, so I was wondering how I could simulate communication to/from the serial port so that I can start developing my app?
[I don't yet know how the PLC and the PC are due to communicate - I understand it will be binary rather than text, but at the moment, that is all I know.]
Anthony Mastrean
14.8k1919 gold badges8585 silver badges150150 bronze badges
CJMCJM
9,4492020 gold badges7070 silver badges112112 bronze badges
6 Answers
Abstract away your serial port comms behind an interface so that you can code your app against the interface and then test with a 'fake' implementation. When you've got the hardware for the real thing, you can code up the 'real' implementation of the interface and swap out the fake one.
So for example, you'd have an interface
and you'd code your app against that interface using a fake implementation:
Hope that helps!
DavidGougeDavidGouge
3,38855 gold badges2525 silver badges4242 bronze badges
fryguybobfryguybob
3,73722 gold badges2525 silver badges3535 bronze badges
There are two pieces of software that I have found invaluable while doing serial port work.
Free Serial Port Monitor
Despite the cheesy name, it is actually quite useful. Note that you should have it stop listening to your port if you go to unplug a USB-to-Serial converter. Otherwise it can crash (well.. wait indefinitely on exit, which is annoying). It doesn't have to put itself in the middle of a serial connection to sniff data. It monitors the IO using the Win32 API.
Franson Serial Port Tools
Or. any loopback software really. There are lots out there. This allows you to send data and receive it within software. If you end up doing any GPS work, Franson also has a nice GPS simulator so you don't have to sit outside the whole time to debug code.
Finally, if you have had enough with the built-in serial class and its horrendous shortcomings, then you need a replacement, and going straight to the Win32 API will take forever.
CommStudio
I have found CommStudio to be absolutely rock solid. Quite frankly, after spending 5 months researching and buying other options, it is the only one that works perfectly with removable USB adapters. All of the other solutions have issues when the device is plugged back in. You can download their free 'Express' version here: http://www.componentsource.com/products/commstudio/downloads.html?rv=42917
BradBrad
123k3030 gold badges253253 silver badges413413 bronze badges
There is another resource out there that emulates serial ports for windows if anyone else is still looking for decent serial debugging tools.
The 32-bit version is free and seems pretty decent. It's called Virtual Serial Ports Emulator.
Virtual Serial Port Driver 7.2jlafayjlafay
9,2231212 gold badges6464 silver badges9090 bronze badges
Videos to download free. I like David's answer above but if your looking to do integration tests and actually test your serial port communication I have used and application called ViN soft virtual serial cable in the past to basically create 2 serial ports on your machine that are connected by a virtual cable.
Also if you have a serial port on your development machine you could use it to connect to another machine that has a serial port and write an application that will basically simulate the communication of the PLC.
I would prefer to use a combination of both David's method and this method to ensure proper testing.
Cole WCole W
12k66 gold badges4040 silver badges7878 bronze badges
I have wrote an article on this topic using Virtual Serial Port Driver 9.0 standard using Microsoft SerialPort Class (Sytem.IO.Ports), it is of course possible to use any other comm port tool.
Virtual Serial Port Emulator Free Download For Windows 10
In the software I create 2 virtual ports COM1 and COM2.
I use COM1 to emulate as data sender.
I use COM2 to receive what ever being send from COM1.
This is helpful if you are developing Embedded or IoT solution.
Emulator (in this example as random accelerometer)
And my data receiver is almost similar
Disclaimer: the link of this guideline refer to my personal web site.
maytham-ɯɐɥʇʎɐɯmaytham-ɯɐɥʇʎɐɯ
Free Virtual Serial Port Emulator
13.9k77 gold badges5353 silver badges7777 bronze badges
Not the answer you're looking for? Browse other questions tagged c#serial-portsimulation or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |