Noobie here, need help with simple serial code

I got my first Uno microcontroller and RS232 shield, and I am trying to do the following:

Use a digital input signal from a switch that, when high, will tell the Uno to give a reset serial command to a load sensor controller.

So far, I have verified that my load cell controller is working via hyperterminal (without the Uno plugged in). I had tried some simple serial communication code. So far it compiles ok and uploads ok, but when I push my input switch, the load cell controller does not reset. The command for reset is *1CA

I would think this would be an easy solution, but even going through the tutorials and examples I am not getting a straight answer, or I am simply missing something on the config side of the Uno programming.

Any advice or help will be greatly appreciated!

Any advice or help will be greatly appreciated!

Post your code then we can see if you are doing anything wrong. You might also need to post your schematic as well.
Have you got the grounds of the two systems connected?

The hardware is set up by using the 5Vdc signal on the board, which goes to one side of the switch, and then the other end of the switch goes to the digital input pin 12. I also have a 10K pull down resistor from the input side of the switch to ground on the board. The cable used from the load cell device to the RS232 shields is a null modem (which is called for my the mfg).

Here is the code. It mostly came out of an example file:

int buttonPin = 12;

// setup initializes serial and the button pin
void setup()
{
Serial.begin(9600);
pinMode(12, INPUT);
}

// loop checks the button pin each time,
// and will send serial if it is pressed
void loop()
{
if (digitalRead (12) == HIGH)
Serial.write("*1CA/r/n");
delay(1000);
}

Serial.write("*1CA\r\n");

AWOL, could you help me get the correct Serial.write (or Serial.print) code? The *1CA is the actual reset command to the load cell controller, and it has a line feed and carriage return to it. I have tried the serial.print command, and if I have the serial monitor on, it will read the characters back to me. Thanks.

and it has a line feed and carriage return to it.

The one you wrote above does not have a "carriage return" "line feed" in it, it has the character sequence "/r/n", which is why I corrected it to "\r\n"

oops...I forgot I had the slashes backwards. I rewrote the command.

It still will not reset my load cell device, though. However, on serial monitor it is returning *1CA. I am wondering if I will need to write the code to convert the command to Hex format?

It still will not reset my load cell device, though. However, on serial monitor it is returning *1CA.

You can only have one thing connected to the serial port - either the Serial Monitor or the load cell. If the data appears on the serial monitor, it isn't getting to the load cell.

Oh ok, that makes sense. I need to unplug the USB connection when testing with the load cell controller.

BTW, scratch the hex idea, the manual for the controller has the protocol in custom ASCII. According to the Arduino tutorials, a serial.print() will send the data in ASCII format to the serial device.

I am still not able to get it to work. Thanks for the previous responses in this post. I am already learning alot about the system.

Does anyone out there have a serial code that writes a command to a device just like a CPU would when communicating through hyperterminal?

I am still not able to get it to work.

This suggests that it is not a software problem, but a hardware problem. It's time for you talk more about that. What is this device you are trying to communicate with (a link, please) and how is it connected to the Arduino (a schematic, a picture, or both).

Here is the link to the load cell controller

http://www.futek.com/ibt500.aspx

The connection between the arduino and the controller is a 9 pin RS232 cable (null modem). I had to also use a male to male gender connector between the RS232 cable and the RS232 port of the Arduino. The Arduino has the RS232 shield plugged into it on the top. The digital input is a NO switch with one end connected to 5V and the other connected to pin 12 of the Arduino.

I also forgot to mention that is has a 10Kohm pull down resistor to ground from the switch. I tried using a command that would give readout information, and the Arduino will transmit but will not receive. There must be some config code (availability, etc...)I may need to put in there.