Member Login
Search
Past & Future Posts
Sponsored Communities
Neat Stuff

Visit our shop for nerds in control lifestyle products.
Cool stuff
Thermal Overload
The threads that wouldn't die...
- PC reliability?
- Windows, real time
- PID loops
- PCs vs. PLCs
- Replacing people
- MS 'monopoly'?
- Software quality
- Where do we go from here?
- Why pay?
- PC reliability?
- Windows, real time
- PID loops
- PCs vs. PLCs
- Replacing people
- MS 'monopoly'?
- Software quality
- Where do we go from here?
- Why pay?
Fortune
About the only thing on a farm that has an easy time is the dog.
RSS Feed
www.control.com/rss
from the Having a tough time finding solid information... department...
RS232 in Win2k using Visual C++Hello.
I am working with hardware that receives its commands serially over fiber. I have a bunch of RS232-to-fiber adapters, and would like to write some C/C++ code to send data over a serial port in the particular protocol I am using.
I have had a tough time finding a straight-forward article or resource on this topic.
I should mention I am using Visual C++ 6.0, running on Windows 2000. Is this version of C++ new enough?
It would seem to me there would exist some library to facilitate this function; I just don't know where to look. Any help would be greatly appreciated. Thank you.
I am working with hardware that receives its commands serially over fiber. I have a bunch of RS232-to-fiber adapters, and would like to write some C/C++ code to send data over a serial port in the particular protocol I am using.
I have had a tough time finding a straight-forward article or resource on this topic.
I should mention I am using Visual C++ 6.0, running on Windows 2000. Is this version of C++ new enough?
It would seem to me there would exist some library to facilitate this function; I just don't know where to look. Any help would be greatly appreciated. Thank you.
Take this:
http://pvbrowser.sourceforge.net/manual/rllib/classrlSerial.html
Download here:
http://pvbrowser.org/pvbrowser/index.php?menu=7&topic=7&su btopic=4
http://pvbrowser.sourceforge.net/manual/rllib/classrlSerial.html
Download here:
http://pvbrowser.org/pvbrowser/index.php?menu=7&topic=7&su btopic=4
Questions like this really make me feel my age.
It used to be that when you bought computer controlled hardware, you got sample code, at least in basic, and probably C. Often you got a floppy (what's a floppy?)
with driver software sources to add to your projects.
Talk to the vendor. If they don't have this, see if they have some customers that are doing a similar thing and talk to them (assuming they're not competitors).
What type of hardware is it? There might be appropriate newsgroups. If you have no newsreader, use google groups.
Otherwise, you're in the next best place (sometimes the best) for information right here on the automation list.
Oh, and yes, VC++ V. 6.0 is more than sufficient.
Rufus
It used to be that when you bought computer controlled hardware, you got sample code, at least in basic, and probably C. Often you got a floppy (what's a floppy?)
with driver software sources to add to your projects.
Talk to the vendor. If they don't have this, see if they have some customers that are doing a similar thing and talk to them (assuming they're not competitors).
What type of hardware is it? There might be appropriate newsgroups. If you have no newsreader, use google groups.
Otherwise, you're in the next best place (sometimes the best) for information right here on the automation list.
Oh, and yes, VC++ V. 6.0 is more than sufficient.
Rufus
Hi
I had to connect to a Forte system using RS-232 and useing C++ 6.0. I found the book Serial Communications developers guide (Mark Nelson) ideal. In short you treat the com port as a file, and you read and write to the file. I do suggest that you use a seperate thread for the com. port part of your program.
Hope this helps.
Dan Brown
I had to connect to a Forte system using RS-232 and useing C++ 6.0. I found the book Serial Communications developers guide (Mark Nelson) ideal. In short you treat the com port as a file, and you read and write to the file. I do suggest that you use a seperate thread for the com. port part of your program.
Hope this helps.
Dan Brown
Hi
You can use MSComm control. This is Microsoft ActiveX you can use to control RS232 in W2K.
Regards
Andrzej
www.modbus.pl
You can use MSComm control. This is Microsoft ActiveX you can use to control RS232 in W2K.
Regards
Andrzej
www.modbus.pl
Hello.
You must look for stuff relating to I/O streams and Asynchronous I/O. You write or read data from a serial port just as you are doing I/O with an ordinary file; just that you have to define COM1 or COM2 in your call to CreateFile() with particular settings of other parameters that you must look forward in a related text.
You must look for stuff relating to I/O streams and Asynchronous I/O. You write or read data from a serial port just as you are doing I/O with an ordinary file; just that you have to define COM1 or COM2 in your call to CreateFile() with particular settings of other parameters that you must look forward in a related text.
Hello,
Win2k/NT/98 etc all have a comman API which is used to program the serial port. It is called the Win32 Comm API. I must admit, its not so easy to get started with this straight away. The API is difficult to use.
There are several websites that provide, good resources on programming in VC++ 6.0 for the Comm API.
There are commercial libraries available that provide easy to use functions for programming the serial port. These libs hide the intricacies of the Win32 Comm API and provide easy to use functions like open_port(), read(), write().
For more details and help on programming serial ports in VC++, send me an email at punita@tatvik.com.
regards
Win2k/NT/98 etc all have a comman API which is used to program the serial port. It is called the Win32 Comm API. I must admit, its not so easy to get started with this straight away. The API is difficult to use.
There are several websites that provide, good resources on programming in VC++ 6.0 for the Comm API.
There are commercial libraries available that provide easy to use functions for programming the serial port. These libs hide the intricacies of the Win32 Comm API and provide easy to use functions like open_port(), read(), write().
For more details and help on programming serial ports in VC++, send me an email at punita@tatvik.com.
regards
Hello Punita
Thank u for the kind suggestion made regarding the serial interfacing.
Could u please give me the details of the Commercial libraries u said about for the serial interfacing with VC++?
Thanking You
Gopi
Thank u for the kind suggestion made regarding the serial interfacing.
Could u please give me the details of the Commercial libraries u said about for the serial interfacing with VC++?
Thanking You
Gopi
hello,
I would like to ask on how to use VISUAL C++ to communicate with the RS-232 of the computer? I am trying to write a code for my RFID (from Texas instruement) and was planning to use the RS232 as my communication port from the host computer to the "reader".A sample program on how to access the serial port as an I/O would be a lot of help. Thank you very much.
I would like to ask on how to use VISUAL C++ to communicate with the RS-232 of the computer? I am trying to write a code for my RFID (from Texas instruement) and was planning to use the RS232 as my communication port from the host computer to the "reader".A sample program on how to access the serial port as an I/O would be a lot of help. Thank you very much.
Yapster,
I'm looking for the same code for the same technology (RFID). could you help or send me some code?
jair105764@yahoo.com
I'm looking for the same code for the same technology (RFID). could you help or send me some code?
jair105764@yahoo.com
Hi,
Can i get this sample code for my project? if possible, then send me this code on vikrant_salunkhe@rediffmail.com or call me on 919890137697 in india.
Can i get this sample code for my project? if possible, then send me this code on vikrant_salunkhe@rediffmail.com or call me on 919890137697 in india.
hello,
please send to me code send file comport into visual c++ 6.0. thank you.
please send to me code send file comport into visual c++ 6.0. thank you.
see in programmersheaven.com
so if you find something please send me. thank you.
so if you find something please send me. thank you.
Simply strange,,, just write your own library.?? I did
// COM32.CPP
// -----------
// WIN32 communications library interface
hCom = ::Open_Comport (1, 9600);
::Close_Comport (hCom);
::Read_Comport (hCom, &BytesRead, BufferSize, Buffer);
::Write_Comport (hCom, buffer.GetLength(), buffer);
// -----------
// WIN32 communications library interface
hCom = ::Open_Comport (1, 9600);
::Close_Comport (hCom);
::Read_Comport (hCom, &BytesRead, BufferSize, Buffer);
::Write_Comport (hCom, buffer.GetLength(), buffer);
Hi
I used V C++ to use the serial port to comunicate with a Forte moisture measurment system. I used a book called Serial Communications developers's guide by Mark Nelson (M & T Books). You can contact me if you need any more info.
I used V C++ to use the serial port to comunicate with a Forte moisture measurment system. I used a book called Serial Communications developers's guide by Mark Nelson (M & T Books). You can contact me if you need any more info.
Hello
A very good site to understand serial communication is http://www.beyondlogic.org.
Also for programming serial port in Windows environment, msdn is the best place for resources and guides.
Regards
Kunal Lagwankar
A very good site to understand serial communication is http://www.beyondlogic.org.
Also for programming serial port in Windows environment, msdn is the best place for resources and guides.
Regards
Kunal Lagwankar
Hi, do you still have the code for communicating with the serial port? I currently need the pc to communicate with the serial port but I also can hardly find any book or article on this topic. If you still have the code, do you mind to tell me? Really thank you very much!
From Control Engineering magazine...
Related articles from Control Engineering magazine- ODVA, DeviceNet: New CIP specs; ControlNet added; 2009 meeting
- Embedded, wireless devices, dynamic IP routing
- Listen in: Wireless developments for Air Force may influence industrial applications
- Easier implementation: Kits for cable testing, wireless products
- Inside look: How MTL Instruments fits with Cooper Industries
- Ethernet hardware: Switches and more
- Frost & Sullivan awards honors many automation, controls companies
- ABB update: User conference, exhibition, flow, SCADA, wireless
Above articles copyright 2008 Reed Business Information. Subject to its Terms of Use.
Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2008 Control Technology Corporation. All rights reserved.
Users of this site are benefiting from open source technologies, including PHP, PostgreSQL and Apache. Be happy.
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Patronize our advertisers!



