Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming

Reply
 
LinkBack Thread Tools
Old 06-24-09   #1 (permalink)
Audiophile
 
Gnarly's Avatar
 
intel nvidia

Join Date: Oct 2004
Location: Missouri
Posts: 2,198

Rep: 113 Gnarly is acknowledged by manyGnarly is acknowledged by many
Unique Rep: 91
FAQs Submitted: 2
Trader Rating: 4
Default Which language makes it Serial Port Communication Easy?

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
__________________
System: Promise of Stress
CPU
Q9450
Motherboard
GIGABYTE GA-EP35-DS3L P35
Memory
4x2gb G.Skill DDR2 800
Graphics Card
evga gtx 260 192
Hard Drive
640gb WD + 750gb Samsung
Sound Card
Flashed Chaintech AV710 for optical out
Power Supply
Corsair HX520W
Case
Coolermaster CM690
CPU cooling
lapped Tuniq Tower
OS
Vista Business x64
Monitor
24" Samsung

Last edited by Gnarly : 06-25-09 at 07:34 PM Reason: rethunk it
Gnarly is offline   Reply With Quote
Old 06-25-09   #2 (permalink)
Audiophile
 
Gnarly's Avatar
 
intel nvidia

Join Date: Oct 2004
Location: Missouri
Posts: 2,198

Rep: 113 Gnarly is acknowledged by manyGnarly is acknowledged by many
Unique Rep: 91
FAQs Submitted: 2
Trader Rating: 4
Default

bump
__________________
System: Promise of Stress
CPU
Q9450
Motherboard
GIGABYTE GA-EP35-DS3L P35
Memory
4x2gb G.Skill DDR2 800
Graphics Card
evga gtx 260 192
Hard Drive
640gb WD + 750gb Samsung
Sound Card
Flashed Chaintech AV710 for optical out
Power Supply
Corsair HX520W
Case
Coolermaster CM690
CPU cooling
lapped Tuniq Tower
OS
Vista Business x64
Monitor
24" Samsung
Gnarly is offline   Reply With Quote
Old 06-25-09   #3 (permalink)
With great difficulty
 
rabidgnome229's Avatar
 
intel nvidia

Join Date: Feb 2006
Location: Pittsburgh
Posts: 5,210

Rep: 614 rabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famousrabidgnome229 is becoming famous
Unique Rep: 370
FAQs Submitted: 6
Trader Rating: 5
Default

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");
I can't see serial being all that different
__________________
System: It goes to eleven
CPU
E6300
Motherboard
DS3
Memory
2GB XMS2 DDR2-800
Graphics Card
EVGA 8600GTS
Hard Drive
1.294 TB
Sound Card
Audigy 2 ZS
Power Supply
Corsair 520HX
Case
Lian-Li v1000B Plus
CPU cooling
TTBT
GPU cooling
Thermalright V2
OS
Arch Linux/XP
Monitor
Samsung 226bw
rabidgnome229 is offline Overclocked Account   Reply With Quote
Old 06-30-09   #4 (permalink)
Overclocker in Training
 
KClaisse's Avatar
 
intel nvidia

Join Date: Oct 2007
Location: California
Posts: 356

Rep: 16 KClaisse Unknown
Unique Rep: 15
Trader Rating: 0
Default

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! clickme

My personal best 3dmark06 score: 18277

My personal best 3dmark Vantage score: P15708


System: My Gaming Rig
CPU
Q9550 E0 @ 4.03GHz (475x8.5) 1.376v LLC Enabled
Motherboard
Gigabyte GA-EP45-UD3P
Memory
8GB (4x2GB) Dominators
Graphics Card
EVGA GTX285SC 730/1674/1404 (core/shader/mem)
Hard Drive
4x WD7500AAKS + 1 WD Black 500gb + 2x WD Black 1TB
Sound Card
Creative X-Fi Titanium Fatal1ty Pro
Power Supply
CoolerMaster 850W Real Power Pro PSU
Case
CoolerMaster Stacker 832
CPU cooling
D-Tek FuZion v2 w/ Quad Core insert
GPU cooling
EK Full Coverage EK-FC285 Nickel Plated
OS
Windows Vista Ultimate SP2 x86-64
Monitor
ViewSonic vx2025wm + Acer x206w

Last edited by KClaisse : 06-30-09 at 10:04 PM
KClaisse is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 07:38 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.12231 seconds with 8 queries