Serial Comunication - RS232/RS485 Hi, I need help on how to collect the information of the serial port. The equipament works with comunication patterns RS-232 or RS-485. I'm totally lay about serial comunication using Delphi and I need the information the most detailed possible. []s Fabrcio Fadel Kammer |
Re:Serial Comunication - RS232/RS485'Fabrcio Fadel Kammer' <[email protected]> wrote Quote> I need help on how to collect the information of the serial port. The output of your 485 device or devices? Is there more than one device? Let us know here! While getting that together, I recommend that you download and install the TComPort component by Dejan Crnila.and get a 485 to RS-232 converter module, such at the 485SD9TB by B&B Electronics. Regards, JohnH |
Jul 11, 2013 ตัวอย่างพื้นฐานการเขียนโปรแกรม Delphi เพื่อเชื่อมต่อกับพอร์ตสื่อสาร.
Re:Serial Comunication - RS232/RS485On Mon, 29 Apr 2002 14:27:28 -0300, 'Fabrcio Fadel Kammer' Quote<[email protected]> wrote: the port as a file, using the Windows API. This can get very involved, very quickly, but a few things to look up in the help files are are CreateFile, DCB, Overlapped, SetCommTimeouts, ReadFile, WriteFile and ... well that should get you headed in the right direction. An alternative is to use an existing serial port component. Commercially, TurboPower's offering gets good press, but I have never used it myself. There are a number of free components on the usual Delphi web sites. Some are better than others, so look at several before you choose. Personally I roll my own, so I know what I have. In terms of RS232 or RS485, your choice depends upon your application. (As a rough guide, RS422 is a balanced RS232, and RS485 is a multi-drop RS422). If your serial cable(s) will be short and you only have one device per cable, go with RS232. If you need longer distances and/or will be networking devices, use RS485 - but this is more complex, as you will have to deal with some kind of addressing mechanism. Also, you will need RS485 hardware in your PC. In terms of reading and writing the port, though, there is no real difference. -- Duncan |
Re:Serial Comunication - RS232/RS485Hi John, I don't know as to discover which is the comunication protocol used by the device. I thought that RS485 possessed an own communication protocol. I already have TComPort installed in my Delphi. []s Fabrcio Fadel Kammer Quote> 'Fabrcio Fadel Kammer' <[email protected]> wrote |
Re:Serial Comunication - RS232/RS485'Fabrcio Fadel Kammer' <[email protected]> wrote Quote> I don't know [how to discover the comunication protocol] ... model? I will try find a sample program for gathering info on protocol and post to attachments forum w/o an hour. JohnH |
Re:Serial Comunication - RS232/RS485RS485 is a different driver with different levels. It allows up to 1500m distance. While RS485 is bidirectional on one pair, the direction has to be switched. This is hardly doable with a PC, meaning the PC is too slow. The preferred way is to use RS422, identical to RS485 but with 2 pairs and no direction switching. You can use the same protocols as for RS232, but have to make some adjustments when multiple devices are on the cable. Rene -- Ing.Buero R.Tschaggelar - http://www.ibrtses.com Quote'Fabrcio Fadel Kammer' wrote: |
Re:Serial Comunication - RS232/RS485Yes John, It's a scale marks Toledo, model Prix III, made in Brazil. []s Fabrcio Fadel Kammer Quote> 'Fabrcio Fadel Kammer' <[email protected]> wrote |
Re:Serial Comunication - RS232/RS485Caso queira suporte profissional para esta tarefa podemos lhe ajudar, solicite um orcamento. Quote> Hi, |
Re:Serial Comunication - RS232/RS485Hi Saci, I thank his offer, but I want to remind you that a discussion list is a place for people interesting in helping others. Fabrcio Fadel Kammer 'Saci' <[email protected]> escreveu na mensagem news:3cce8b12_2@dnews... Quote> Caso queira suporte profissional para esta tarefa podemos lhe ajudar, |
1. Serial comunication (RS232)
2. Writing Drivers in DELPHI - RS232, RS485
3. I need serial comunication class
![Arduino Arduino](/uploads/1/2/6/3/126303096/423376771.jpg)
4. Delphi: Printing to serial printers connected to RS232?
5. serial rs232
6. Setting the RS232 serial COM1 port speed
7. Can I control devices via RS232 serial port?
8. rs232 serial connection
9. Delphi 6 high cpu usage during datatransfer via serial comport (RS232)
10. serial / com / rs232 delphi native object
Software Serial Example
Arduino and Genuino boards have built in support for serial communication on pins 0 and 1, but what if you need more serial ports? The SoftwareSerial Library has been developed to allow serial communication to take place on the other digital pins of your boards, using software to replicate the functionality of the hardwired RX and TX lines. This can be extremely helpful when the need arises to communicate with two serial enabled devices, or to talk with just one device while leaving the main serial port open for debugging purpose.
In the example below, digital pins 10 and 11 on your Arduino or Genuino boards are used as virtual RX and TX serial lines. The virtual RX pin is set up to listen for anything coming in on via the main serial line, and to then echo that data out the virtual TX line. Conversely, anything received on the virtual RX is sent out over the hardware TX.
Hardware Required
- Arduino or Genuino Board
Circuit
There is no circuit for this example. Make sure that your Arduino or Genuino board is attached to your computer via USB to enable serial communication through the serial monitor window of the Arduino Software (IDE).
image developed using Fritzing. For more circuit examples, see the Fritzing project page
Schematics
image developed using Fritzing. For more circuit examples, see the Fritzing project page
Code
See also
- TwoPortReceive – Two serial ports that receive data switching from one to the other one when a special character is received.
- MultiSerialMega - Use two of the serial ports available on the Arduino and Genuino Mega.
- Serial Call Response - Send multiple vairables using a call-and-response (handshaking) method.
- Serial Call Response ASCII - Send multiple variables using a call-and-response (handshaking) method, and ASCII-encode the values before sending.
Last revision 2018/05/17 by SM