|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming | |
Which language makes it Serial Port Communication Easy?
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | ||||||||||||
|
Audiophile
![]() |
Sorry for posting so much, but each time one of you has been a big help!!!
__________________EDIT: So I've written a C++ that generates a string of data to be sent through a serial port. However, the solutions for serial comm with C++ aren't working for me. Now I think it would be easier to write another little program in Python, Matlab, or ?other? to send the data. Python seems the easiest, but I'm having trouble getting started. So... Which program or programming language could I use my C++ code to send data through the serial port? Thanks, Wyatt If anyone has sent data through the serial port using C++ and Windows API, I'd appreciate a quick lesson. Currently I'm trying to use these two solutions. It's hard to search Google, because many of them are for Visual C++, and I don't have the hundreds of Visual libraries to get them to compile. 1. http://www.pvbrowser.org/pvbrowser/s...3897197a475ded 2. http://www.codeproject.com/KB/system/serial.aspx BTW, there is a whole fricken book dedicated to the subject: http://www.amazon.com/C-Programmers-.../dp/0672302861 Is there any easier solution? I don't need fancy stuff. Just open a specific port, and use my other C++ program to stream data to it every 16ms (which I've already set up). Everything I find online is robust and confusing. I tried reading Microsoft's documentation, but I do not have enough experience to understand it/put it to use. Thanks, Wyatt
Last edited by Gnarly : 06-25-09 at 07:34 PM Reason: rethunk it |
||||||||||||
|
|
|
|
|
#2 (permalink) | ||||||||||||
|
Audiophile
![]() |
bump
__________________
|
||||||||||||
|
|
|
|
|
#3 (permalink) | |||||||||||||
|
With great difficulty
![]() |
Python or perl should be pretty well abstracted, although I can't say that I have experience with serial communications in either. Here's UDP in perl, though, and UDP is a bit of a more complex protocol
__________________Code:
my $socket=new IO::Socket::INET->new(PeerAddr=>'foo.bar.com',
PeerPort=>1234,
Proto=>'udp');
$socket->send("Hello, world");
|
|||||||||||||
|
|
|
|
#4 (permalink) | |||||||||||||
|
Overclocker in Training
|
I'm pretty sure the Twisted framework has some stuff for serial port communication.
EDIT: Yes, its twisted.internet.serialport. The documentation on it is next to none, but the code for the module is kind of helpful, you can see that here, just click the class you want to view and on the next page click view source. I haven't personally worked with this particular module so Im afraid I can't give any pointers.
__________________
Q9550 + UD3P @ 4GHz and stable! clickmeMy personal best 3dmark06 score: 18277 My personal best 3dmark Vantage score: P15708
Last edited by KClaisse : 06-30-09 at 10:04 PM |
|||||||||||||
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|