RS485 communication
-
Is there somebody who has communicated with serial port (RS485). Any example would be great. Thanks
-
Is there somebody who has communicated with serial port (RS485). Any example would be great. Thanks
RS-485 communication is actually exactly the same as RS-232 communication. Only the hardware is a bit different. In WIN32, this is fairly easy. You use the COM port just like a file. You open the port with CreateFile and supply e.g. "COM2" as the filename. You have to call SetCommTimeouts to specify the timeout values and SetCommState to specify baudrate, parity and the like. The you just call ReadFile and WriteFile for your communications and CloseHandle when you're finished. When using RS-485, you will likely use the DTR/RTS mechanism. You can change the state of these lines by calling EscapeCommFunction. ================== The original message was: Is there somebody who has communicated with
serial port (RS485).
Any example would be great.
Thanks -
Is there somebody who has communicated with serial port (RS485). Any example would be great. Thanks
================== It depends if you have a card capable of driving RS485 installed on your PC. If you have you should be able to configure your interrupts on that card so that they may be on say COM3 or COM4. If you haven't got a card you can get a RS232 to RS485 converter and communicate through COM1 or COM2 on your PC's serial ports.
-
Is there somebody who has communicated with serial port (RS485). Any example would be great. Thanks
I use a National rs-485 card and the ports are used just like rs-232 as for as the win32 API is concerned. So all standard serial port programming techniques apply. What specifically is the problem? Any external devices attached to the rs-485 line always have their own specific protocols, and you just have to get their manuals and do the work yourself. ================== The original message was: Is there somebody who has communicated with
serial port (RS485).
Any example would be great.
Thanks -
Is there somebody who has communicated with serial port (RS485). Any example would be great. Thanks
Use a RS232/RS485 convertor and all the WIN32 API calls will work. U may have to set RTS control to RTS_CONTROL_TOGGLE for 2 wire operation. Prashanth ================== The original message was: Is there somebody who has communicated with
serial port (RS485).
Any example would be great.
Thanks