basic question about NewSoftSerial

Situation:
I have Arduino hooked up to an external RS-232 device, via NewSoftSerial library, to pin 2 (defined as RX on NewSoftSerial) and pin 3 (TX).
I don’t know why it is that I’m able to TX/transmit data using these new pins but not receive data to the Arduino from the external device (i.e., I have the code printing out NewSoftSerial’s received data using regular Arduino serial, on the PC serial monitor, and prinout is completely silent).
(Note: When I use the default Arduino RX (pin 0) directly for receiving the data from the external device, then data prints out perfectly.)

Question:
What is a very basic way (wiring/coding) I can test out the receive functionality of NewSoftSerial?
(without my external device)
I’m wondering why the receive functionality seems not to be working in my case.

Here is my present code:

#include <NewSoftSerial.h>

NewSoftSerial mySerial =  NewSoftSerial(2, 3);

unsigned long start = 0;

void setup() {
  mySerial.begin(19200);
  Serial.begin(19200);
}

void loop() {
  mySerial.print('D'); mySerial.print(13,BYTE);
  // transmit a 'D' command out to the external device, which is
  // supposed to trigger the device to send out data to Arduino

    start = millis();
    while (!mySerial.available() && (millis()-start) < 300) {}
    // do nothing while nothing received on mySerial for 300 ms

    while (mySerial.available() ) {
        Serial.print((char)mySerial.read());
    }
    // when data received on mySerial, print it on Serial to computer
    // Note: when I instead change the code to reading via the regular
    // Serial RX pin of Arduino (and rewire), data prints out fine.

  delay(300);
}

I have Arduino hooked up to an external RS-232 device

Which device is that? Is it outputting TTL level voltages or RS232 level voltages (which will fry the Arduino)? Are you using a MAX232 chip in between? Are the levels getting inverted, which would require specifying the third argument for the NewSoftSerial constructor?

  mySerial.print('D'); mySerial.print(13,BYTE);
  // transmit a 'D' command out to the external device, which is
  // supposed to trigger the device to send out data to Arduino

The comments should go before the code, not after. Are you use that the 13 is all that is required? Perhaps the device needs a 13 and 10 after the D, which would be supplied by using mySerial.println('D'); instead of 2 or 3 print statements.

@Paul: The device is a force gauge (with RS-232 output). I'm using MAX232 for the level shifting, yes.

Actually, I'm able to read the data fine when using the default RX pin (i.e., pin 0) of Arduino (and thus of course see pulses on the receive line using a scope), and I'm able to transmit fine with the NewSoftSerial-defined pin 3 (so I assume the characters I'm sending are correct)... But it's just when I receive with NewSoftSerial-defined pin 2 that I see nothing, hence all the more confusing.

That's why I was wondering if there's something code-wise that I might be doing wrong, and wanted to test the NewSoftSerial receive functionality with something very basic that doesn't involve any extra factors.

Question: Would it be safe/meaningful to criss-cross wires from TX and RX of NewSoftSerial-defined pins to the RX and TX of Arduino's regular/default Serial-defined pins, and try communicating with a basic program to test?

Question: Would it be safe/meaningful to criss-cross wires from TX and RX of NewSoftSerial-defined pins to the RX and TX of Arduino's regular/default Serial-defined pins, and try communicating with a basic program to test?

Yes, it would be safe. It would also be meaningful. Lots of people, myself include, use NewSoftSerial to read data, so I doubt that the problem is in NewSoftSerial.

I have Arduino

Which one?

PaulS:

I have Arduino

Which one?

Paul, Very useful two-word question as it turns out! Until now, was using a standalone Atmega 328P chip. NewSoftSerial worked with TX, failed with RX. Tried Arduino Mega. NewSoftSerial worked with TX again, failed with RX (but non-support for Mega was stated on NewSoftSerial webpage, so wasn't surprised).

FINALLY, tried Arduino Uno. NewSoftSerial worked with TX, and with RX too... beautiful!

Good result but... Any thoughts on why it doesn't work with standalone Atmega 328 chip / suggestions for how to make it work?