Hello! I have a project which requires to ask radiation scaler to start counting using RS232. The radiation scaler that I use is Ludlum M2200. There are several commands (attached) that can be used to manage the radiation scaler. At first, I connected my Ludlum to PC using RS232-USB cable (https://tokopedia.link/QurWnQ8x0zb). This worked just fine along with the commands I sent to Ludlum. However when I tried to use RS232-TTL converter module (https://tokopedia.link/P6otoHpy0zb), it didn't work, even the scaler won't start counting.
This is the program I wrote:
#include <SoftwareSerial.h>
const int RX_PIN = 8; // Pin arduino untuk receive data
const int TX_PIN = 9; // Pin arduino untuk transmit data
SoftwareSerial RS232(RX_PIN, TX_PIN);
void setup() {
Serial.begin(9600);
RS232.begin(2400);
//RS232.print("SS\r\n");
}
void loop () {
RS232.print("SO\r\n");
delay(4000);
}
This is the communication that is used by Ludlum M2200
Maybe the scaler is meant to be used with true RS232 voltage levels from a PC port and so should have +5V and -5V ( or +/- 12V) signals instead of +5V and 0V.
The TTL-RS232 adapter that the OP is using should take care of that - the link says that it has a MAX3232 chip which I believe has the charge-pump circuitry to generate those sorts of voltages.
Can you try again on your PC and this time turn off any form of handshaking in your comms program. I think it may be something like Flow Control = None or similar wording.
Good point! The TTL side of the RS-232-TTL adapter has only Rx & Tx signals not the handshake signals CTS & RTS, so those are missing and there is no complete communication.
You can override/bypass the RTS & CTS hardware handshaking by connecting RTS signal to the CTS signal.
If your RS-232 cable is wired for all 9 pins of the DB-9 connector, then those handshake signals should make it through to the DB-9 connector on your RS232-TTL adapter board. You should be able to connect the RTS pin and the CTS pin together on the underside of the board using a short wire between the pins of the DB-9 connector.
That should convince the instrument that it is OK to send data.
Also from this software I used, I noticed the light of CTS and DSR have to be "ON
" so the Ludlum can make connection to PC (?). Does this mean anything? @markd833
That would suggest that RTS & CTS are not used. However it could be that the PC adapter is driving CTS anyway.
Are you saying that you can turn the CTS & DSR indicators off and the Ludlum stops communicating?
Yes, that's correct.
Pins 7 & 8 on your 9-pin D-Conn in post #16 are the RTS & CTS signals. They are the middle 2 unsoldered pins on the board.
Also retry, as others have suggested, swapping over the rx & tx signals going to your Arduino. You can do that in your code, or by physically swapping the 2 wires over. The latter is obviously quicker!