12/9/2013 8:53 AM | |
Posts: 6 Rating:
|
please tell me the purpose of rts pin in cb1241. and i am using modbus rtu. is rts pin use with modbus or not?? |
12/13/2013 12:24 PM | |
Joined: 1/17/2007 Last visit: 8/21/2024 Posts: 1545 Rating:
|
I have no idea why they have this pin on this module. Maybe they were considering using it to enable the transmitters for external devices using half-duplex RS485 (as I mentioned in my earlier response). I have been involved in the design of in-house RS232/RS485 convertors that worked like this. It is quite common to do it that way. But having searched the documentation, it appears that RTS control (hardware flow control) is not permitted on RS485 ports. So in this particular case, it appears that the RTS pin serves no purpose. CTS pin is only applicable to RS232 or RS422. Again it has no purpose is RS485, hence why it is not present. According to the manual, the RTS line is only applicable to RS232/RS422 and can be set to one of 2 modes of operation using the FLOWCTRL input for the PORT_CFG block:- 1) Always ON - RTS is set high permanenly 2) Hardware RTS switched - RTS is held low and switched high for the duration of the transmit phase. See section 12.3.2.1 of the S71200 manual (copied below for convenience). For modbus interface, the S7-1200 has a built in modbus driver. There are plenty of S7-1200 modbus example projects about on this forum that you can use as a starting point (do a search). I also suggest that you read section 12.5.3 of the S7-1200 manual as this contains all the information you require on how to program the CB1241 to communicate to modbus devices. If you do not have a good grasp of the basics of modbus, then I suggest that you read the sticky tip Modbus General Description first. I hope this helps. 12.3.2.1 Managing flow control Flow control refers to a mechanism for balancing the sending and receiving of data transmissions so that no data is lost. Flow control ensures that a transmitting device is not sending more information than a receiving device can handle. Flow control can be accomplished through either hardware or software. The RS232 CM supports both hardware and software flow control. The RS485 CM and CB do not support flow control. The 422 mode of the CM 1241 RS422/485 module supports software flow control. You specify the type of flow control either when you configure the port (Page 583) or with the PORT_CFG instruction (Page 568). Hardware flow control works through the Request-to-send (RTS) and Clear-to-send (CTS) communication signals. With the RS232 CM, the RTS signal is output from pin 7 and the CTS signal is received through pin 8. The RS232 CM is a DTE (Data Terminal Equipment) device which asserts RTS as an output and monitors CTS as an input. Hardware flow control: RTS switched If you enable RTS switched hardware flow control for an RS232 CM, the module sets the RTS signal active to send data. It monitors the CTS signal to determine whether the receiving device can accept data. When the CTS signal is active, the module can transmit data as long as the CTS signal remains active. If the CTS signal goes inactive, then the transmission must stop. Transmission resumes when the CTS signal becomes active. If the CTS signal does not become active within the configured wait time, the module aborts the transmission and returns an error to the user program. You specify the wait time in the port configuration (Page 583). The RTS switched flow control is useful for devices that require a signal that the transmit is active. An example would be a radio modem that uses RTS as a "Key" signal to energize the radio transmitter. The RTS switched flow control will not function with standard telephone modems. Use the RTS always on selection for telephone modems. Hardware flow control: RTS always on In RTS always on mode, the CM 1241 sets RTS active by default. A device such as a telephone modem monitors the RTS signal from the CM and utilizes this signal as a clear-tosend. The modem only transmits to the CM when RTS is active, that is, when the telephone modem sees an active CTS. If RTS is inactive, the telephone module does not transmit to the CM. To allow the modem to send data to the CM at any time, configure "RTS always on" hardware flow control. The CM thus sets the RTS signal active all the time. The CM will not set RTS inactive even if the module cannot accept characters. The transmitting device must ensure that it does not overrun the receive buffer of the CM. |
Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots. |
|
This contribution was helpful to
2 thankful Users |
Follow us on