Solved

How can I send to a serial port from C++?

Posted on 2011-09-02
8
378 Views
Last Modified: 2012-05-12
Ok, I'm not much of a programmer at all. I taught myself to write scripts that are compiled by the Open Watcom C++ compiler. I'd like to know an easy way to send to a serial port, USB or RS-232, either will be fine, the goal is to send some commands to some hardware. I can google and find tutorials on coding for serial ports in C++ but really, I'm hoping I can find something that is more "plug and play". I don't really have a clue what is needed, maybe a dll exists and I can call it from my script? I've always wanted an excuse to get PowerBasic, maybe I have to produce the dll? Maybe there is some code I can copy-paste into my script and compile it??
0
Comment
Question by:FuturesTrader
  • 3
  • 3
8 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 36477047
0
 

Author Comment

by:FuturesTrader
ID: 36477128
The developers of the environment that I'm working in replied to my query on their support boards and told me to change to visual C++ 2008 compiler and use some code from microsoft.com... I'll do that if I have to and there seem to be great articles on the subject, but I'd think there would be something that is directly from C++ or can be called from C++ somehow...
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36477166
Then you should click on "Request Attention" above and get the C++ zone added to your question.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:FuturesTrader
ID: 36477191
The focus is very very narrow with regard to what I want to do. It's going to be one-way communication, sending commands to a hardware keyboard wedge.. There was a product called The Mule that came with some software that made interfacing very easy but that product went off the market... I've not found a wedge that comes with interfacing software as of yet... I want to imbed commands to a USB or Serial Port right in my script...
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 36477212
That's fine but you're not going to get much attention to your question here in "Miscellaneous Programming".  This appears to be the product you're tlaking about: http://www.barcodeman.com/altek/mule/  Here is a similar product: http://www.microridge.com/wedgelink_hw.htm  And here is a software solution if you have a serial port on your computer that you can use: http://www.tec-it.com/data-acquisition/keyboard_software_wedge.htm
0
 

Author Comment

by:FuturesTrader
ID: 36477235
A software wedge won't suit my application, it has to be a hardware wedge and the existing hardware wedges don't seem to come with scripting language help. I think the Mule came with some dll that could be called from a script... I put in a query on ebay to grab a used Mule if one ever comes up, that is how badly I want to avoid learning more programming :)
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 250 total points
ID: 36525992
If you are targetting Windows, be sure to, take a look at http://www.cpdee.ufmg.br/~fvasc/Disciplinas/Interfaces/msdn_serial.pdf - this used to be a MSDN article labelled "Serial Communications in Win32" and is *the* reference for serial programming on Windows.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now