Solved

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

Posted on 2011-09-02
8
380 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

763 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