[SOLVED] Communicating with test equipment using RS232

My goal is controlling an HP signal generator via RS232.

The HP requires simple text strings (ie, “SYSTEM:BEEP”) followed by CR (CRLF optional). Queries returned text strings (ie, “FREQ?”).

When I connect the HP directly (well, via USB/serial adapter) to the computer running CoolTerm I can control the HP. When connected to Arduino I can’t get any response from the HP. (See code, attached.)

When connecting the Arduino to CoolTerm I receive the control string “SYSTEM:REMOTE” but when Arduino is connected to the HP, nothing. (The TD LED flashed on the RS232 adapter connected to the Arduino.)

Ideas?

Thanks.

#include <SoftwareSerial.h>
#define RxPin 2
#define TxPin 3

SoftwareSerial mySerial(RxPin, TxPin); // Receive & Transmit pins

void setup()  
{
  Serial.begin(9600);
  mySerial.begin(9600);
  mySerial.println("SYSTEM:BEEP");
  mySerial.println("SYSTEM:REMOTE");

}


void loop()
{
}

Arduino Diecimila (ATmega168)
Arduino IDE 1.6.1
Schmartboard RS232 module
HP 33120 arb sig gen

The Arduino RS232 are TTL levels (0 to 5V) whereas "standard" RS232 is +/- 12V. Therefore you need a level converter such as the MAX232.

http://en.wikipedia.org/wiki/MAX232

i am.

please see list of resources at the bottom of op.

thanks.

Simple hardware errors ?, like TX/RX swapped? HP unit requires hardware 232 ready etc. ? (use null-modem connection in the connector).

Do you actually a string from HP ?

Sorry if I'm ignorant here, at least I hope it can trigger some ideas.

It's OK if you're ignorant. I'm too (apparently)!

I get nothing from HP: no change of the display, no beep, no RS232 response. For query to HP, I am supposed to see a response. For command, no response, just change in the display.

Thanks.

Coan you list the wiring running list of the 2 setups you are using, as I still suspect a hardware error in your connection method.

correct these running lists to your actual setups :

1) the working setup using PC montor USB to TTL level converter to HP. a) usb cable from PC to usb port on 232 converter b) 232 converter output, standard serial 232 null modem cable to HP

2) the NON-working setup using Arduino USB to 232 converter to HP a) usb cable form Arduino to 232 converter b) 232 converter output, standard serial 232 null modem cable to HP

The depicted setup above wont work with Arduino, as the USB on your PC is a master USB port. On your Arduino the USB is a slave USB port.

Pls note : dont get lost in USB port discussions, if that is NOT the issue, if you are using a different setup than depicted above.

Corrected to:

1) the working setup using PC monitor application: a) RS232 serial null-modem cable direct to HP

2) the NON-working setup using Arduino USB to 232 converter to HP a) direct wiring (jumpers) to 232 converter b) 232 converter output, standard serial 232 null modem cable to HP

Photo here of Arduino & RS232 adapter:

http://imgur.com/9Tq2Txc

Thanks.

ERROR!

Please read corrected configurations here:

1) the working setup using PC monitor application: a) USB cable from PC to USB/serial adapter b) RS232 serial null-modem cable from USB/serial adapter to HP

2) the NON-working setup using Arduino USB to 232 converter to HP a) direct wiring (jumpers) to 232 converter b) 232 converter output, standard serial 232 null modem cable to HP

Thanks.

SOLVED!

Apparently the HP requires null-modem cable when connected to the PC but a regular "non-null-modem" cable when connected to the Arduino.

Thanks to all who helped me with this.


PS, how do I add "SOLVED" to the subject line? The subject line doesn't appear in a Reply so to be able to edit it...

Yes, the old DCE/DTE switcheroo.

Sparkyy: PS, how do I add "SOLVED" to the subject line? The subject line doesn't appear in a Reply so to be able to edit it...

Edit the original post in the thread.