RS232: Sending ASCII Control Strings

I am unsuccessfully trying to send fixed length ascii strings through an Arduino-Uno/RS232-Shield to an emmLabs PRE2 preamp for remote volume control.

Sample String:- *PRVL20NA

I think the problem is that Arduino sends through serial only as individual bytes which are separated by a second control item:- the preamp cannot deal with this structure.

(I am somewhat new to programming!!!!)
Would anyone have a solution?

I can successfully send manually entered control strings through my PC's USB RS232 interface and Realterm terminal program.

A diagnostic capture of the RS232 shows the string sent successfully as one sequential block.
0242.428 Ascii taWaitFrSpc 00000000
0242.428 Ascii taSendBlock 00000000
0242.428 Dispatch WriteCom 00000001 *
0242.428 Dispatch WriteCom 00000001 P
0242.428 Dispatch WriteCom 00000001 R
0242.428 Dispatch WriteCom 00000001 V
0242.428 Dispatch WriteCom 00000001 L
0242.428 Dispatch WriteCom 00000001 2
0242.428 Dispatch WriteCom 00000001 0
0242.428 Dispatch WriteCom 00000001 N
0242.428 Dispatch WriteCom 00000001 A
0242.428 Dispatch WriteCom 00000001 [0D]
0242.428 Dispatch WriteCom 00000001 [0A]

I have no success when connecting the Arduino - RS232 and the preamp and sending strings through code.

A diagnostic capture of the RS232 shows the string sent as individuals.
1297.840 Dispatch ReadCom 00000001 *
1297.840 Trigger Avail 00000001
1297.841 TrDatChg Timer 00000040 [01][00][00][00]
1297.841 Dispatch ReadCom 00000001 P
1297.841 Trigger Avail 00000001
1297.842 Dispatch ReadCom 00000001 R
1297.842 Trigger Avail 00000001
1297.843 Dispatch ReadCom 00000001 V
1297.843 Trigger Avail 00000001
1297.845 Dispatch ReadCom 00000001 L
1297.845 Trigger Avail 00000001
1297.846 Dispatch ReadCom 00000001 2
1297.846 Trigger Avail 00000001
1297.847 Dispatch ReadCom 00000001 0
1297.847 Trigger Avail 00000001
1297.848 Dispatch ReadCom 00000001 N
1297.848 Trigger Avail 00000001
1297.849 Dispatch ReadCom 00000001 A
1297.849 Trigger Avail 00000001
1297.850 Dispatch ReadCom 00000001 [0D]
1297.850 Trigger Avail 00000001
1297.866 Dispatch ReadCom 00000001 [0A]

Code used below:

/*
RS232 Volume Control Reciever -
Sending two volume control codes as ASCII strings
*/
void setup()
{
Serial.begin(9600,SERIAL_8N1 );
}

void loop()
{
serial.print("*PRVL20NA\r\n");
delay(1000);

serial.print("*PRVL50NA\r\n");
delay(1000);
}

Is there meant to be any form of flow control on the interface?

I think the problem is that Arduino sends through serial only as individual bytes which are separated by a second control item

Serial is sent as individual bytes, yes, but what do you mean by "second control item"?

Do you have a link to a manual for the target device?

If you're going to post code, please:

  1. Use code tags
  2. Make sure it's your actual code, not just something you made up when you typed it into your post.

Thanks for the reply.
Full description of RS232 interface is in pages 19 - 25 http://www.emmlabs.com/pdf/manuals/PRE2_Manual.pdf
I have attached the relevant pages to this reply.
It is likely I need to manage flow control, however I lack the knowledge to implement this.

Regarding “second control item”:
My unsuccessful attempt at sending code shows in my diagnostic capture the sequences of Dispatch line followed by Trigger line.
1297.841 Dispatch ReadCom 00000001 P
1297.841 Trigger Avail 00000001
1297.842 Dispatch ReadCom 00000001 R

My successful attempt at sending code direct through my PC shows the sequence “Despatch” for the total string.
242.428 Dispatch WriteCom 00000001 P
0242.428 Dispatch WriteCom 00000001 R

I look forwards to successfully send even one string to the preamp.

PRE2_Manual_RS232.pdf (545 KB)

How are you doing the serial level conversion/inversion?

Edit: sorry, it's there in the first post - do you have a link to the actual device, please?

What are you using to analyse the serial line?

Serial level conversion/inversion.
Perhaps this is the missing link?
I am using the DFRobot rs232 shield.

I have attempted using the SoftwareSerial library. In all cases I can send the ascii string to the Serial Monitor window in the Arduino program. It also displays correctly in my terminal program when I connect my PC RS232 interface to the Arduino running my sketch.

I am using Realterm Serial Terminal to analyse the terminal line.
Perhaps I should be looking at Raspberry PI which I understand has send/receive buffers.

Getting late this side of the world. Will be back in about 8hrs

I might be inclined to try using two stop bits, or spacing the individual characters sent by a couple of hundred microseconds.

When you say you used a terminal, was that typing and sending one character at a time, or sending a whole command in a single continuous transmission?

The Arduino has both transmit and receive serial buffers.

In the terminal software I can send the complete string as one entry by entering it in the dialogue field and pressing sendASCII

I will try your suggestions tomorrow. Thanks

No success with "two stop bits" and "couple of hundred microseconds".

I have found that the volume control on the preamp sends volume codes out through the amps rs232 port. I can read them through my PC terminal serial connection.

I think I need to spend a day or two attempting to read the preamps port through Arduino.

Solution found.

I am now able to send to the preamp ascii codes which change its operation.

Null modem connection between the Arduino shield and the preamp is required.

I finally decided to to scope the input-output of the amps rs232 and also confirm the arduino shields pinouts.

--------It was obvious that the rx and tx required crossing over.--------

I've checked the preamps documentation. It wasn't stated or obvious in the manual diagrams.

Thanks everyone for the advice.