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 );
}
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.
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
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.