Have you confirmed the parts work independently? Thank you Its working now VishnuKanth glad to hear that. You might want to consider accepting this answer; see the Help Center's What should I do when someone answers my question?
Community Bot 1. David Glaude David Glaude 11 1 1 bronze badge. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. I think I wasn't totally clear what i want to achieve. I want to read out 2 or more serial ports at the same time. Because of timeout and readout times it isn't possible to read them out at the same time in one process.
The following approach. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Python Pyserial read data form multiple serial ports at same time Ask Question. Asked 7 years, 1 month ago.
Active 7 years, 1 month ago. Viewed 19k times. Features should be: in the main program I get all open serial ports, open them and append the serial object to serialobjects I want to read each serial port data in one subprocess for parallelization The big problem is: how do I pass the serial port object to the subprocess? Another approch is to parallelize the serial readings in subprocesses.
It is using C language right. There are many to choose from. Processing is free, and has a very similar IDE. If you don't need a fancy gui, and it isn't necessary for this application, then the tiny c compiler would probably do. Ok now i have netbean because i did JAVA project previously.
So can i use netbean? Look at it's documentation for reading and writing serial data. Thanks all of you for kindness replied. The next task is you probably need to see on the PC what's going on, so you might like to copy the communication both sides to the standard serial. I am wondering, is it possible to use 2 usb port at the same time? Actually, i have cable with me! And want to perform the actions through the coding! DOS version of serrecv.
Thank to gomorgan89 that wrote the codes of serrecv. I love them all. I need the code of serrecv. May be they are implemented in turbo C or C-ansi. Anyone knows the location in the internet source code are? Thank you eddy. Re: DOS version of serrecv. I've been having the same problem. Tell me how Error messages Oct I recentiy down loaded source code for. When i tried to compile it on win-xp turbo compiler i got too many error messages.
Flow Control? I liked the article, however it makes no mention of flow control If you added flow control support, you could transfer much more than bytes at a time which is quite a small amount of data for two computers sitting next to each other. Just passing it a string would setup the baudrate AND flow control. That function with a string such as "96,N,8,1,x" would eliminate that switch statment and would build the DCB with the appropriate values.
Good article! Re: Flow Control? Why is bytes the magic number? I did find the article to be very good and it sure does give a great explanation of serial communication programming.
However, due to the small buffer size and the lack of hardware flow control i. If the two computers were a thousand miles apart, I can see taking the precautions of slower data transfer, but since the computers are a few feet away, there's no reason not to transfer data at a higher and faster rate.
Another reason I think think hardware flow control should have been mentioned is for the transfer of binary data. In other words, data that can have a value of 0 through Those fall between 0 and so in some systems, the file's data can be confused as flow control commands.
In all fairness, that wouldn't happen in the code above because the transfer method is proprietary, yet someone may want to adapt the code to do RS communications and that's where they may hit some problems.
All in all, the author got 5 points from me for submitting the article. The reason I ask is because I want to send out about 1K of data to a device, and the data needs to be in Hex but displayed as characters.. I know, weird.
I want to send the block as a 'whole' and just wanted to make sure that I could redefine the as ish and still be ok. The device and the computer are inches apart, and fortuenately, the handshaking is a non issue becuase of the relatively low speed of 56k. Anyhow, thank you very much on shedding some light on this subject!
I just cant figure out whats going on. I am using the function GetLastError to try and shed some more light on the subject, but it seems that it only returns a value of 2. OK, well, I have to ask a stupid question. The computer does actually have a COM1 port, correct? Here is a code fragment I used in the past to open a Serial port. If the open fails, it will put a message box with the explanation of the error not the error value but the description.
The Message routine works with GetLastError so you can use it for any error code not only file type errors Finally, make sure no other drivers are on COM1!
For example, if you have a printer driver set to COM1, the open call will most likely fail. In fact, anything accessing the port will cause the call to fail such as a command prompt that you had just used to send a 'DOS Dump' to the COM1 port, or something like a touchscreen driver set to COM1, etc.
Hi Paul, First off, thank you for replying to my queries. I really appreciate it!
0コメント