Solved

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

Posted on 2011-09-02
8
376 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 82

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 82

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 82

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

23 Experts available now in Live!

Get 1:1 Help Now