This works flawlessly with windows cmd.exe and an prolific usb to serial device:
MODE COM1 BAUD=9600 PARITY=N TO=ON DATA=8 STOP=1 XON=OFF
ECHO :APPL CH1,5,1 >COM1
...
However, I would like to use an Arduino Due, standard setting is 8N1 (data/parity/stop) so I should be good to go, but it doesn't work
void setup() {
Serial1.begin(9600);
}
void loop() {
Serial1.println(":APPL CH1,5,1");
delay(300);
}
This is the adapter that I have connected to PIN18/19 Serial1 TX1/RX1
There is another issue regarding this matter. Altough I can send data to the device, I would like to read back as well.
#include <Wire.h>
#include <jm_LCM2004A_I2C.h>
jm_LCM2004A_I2C lcd;
int inByte = 0;
void setup() {
Serial.begin(9600, SERIAL_8N1);
Serial1.begin(9600, SERIAL_8N1);
Serial2.begin(2400, SERIAL_7N1);
Wire.begin();
lcd.begin();
}
void loop() {
Serial1.println(":APPL CH1,5,1");
Serial1.println(":APPL CH2,10,2");
Serial1.println(":APPL CH3,2,0.1");
delay(500);
Serial1.println(":OUTP CH1,ON");
lcd.clear_display();
lcd.set_cursor(9,1);
lcd.print("CH1 ON");
lcd.set_cursor(0,0);
Serial1.println(":OUTP? CH1");
inByte = Serial1.read();
lcd.set_cursor(1,0);
lcd.print(inByte, BIN);
Serial.println(inByte, BIN);
inByte = 0;
Serial1.println(":OUTP CH2,ON");
delay(500);
Serial1.println(":OUTP CH3,ON");
delay(500);
Serial1.println(":OUTP CH1,OFF");
lcd.clear_display();
lcd.set_cursor(9,1);
lcd.print("CH1 OFF");
lcd.set_cursor(0,0);
Serial1.println(":OUTP? CH1");
inByte = 0;
inByte = Serial1.read();
lcd.set_cursor(1,0);
lcd.print(inByte);
Serial.println(inByte, BIN);
inByte = 0;
delay(500);
Serial1.println(":OUTP CH2,OFF");
delay(500);
Serial1.println(":OUTP CH3,OFF");
delay(500);
}
This is the data out of the serial monitor:
1001111
1001110
1010
1001111
1000110
1000110
1010
1001111
1001110
1010
1001111
1000110
1000110
1010
1001111
1001110
1010
1001111
1000110
1000110
1010
1001111
1001110
1010
1001111
1000110
1000110
1010
It should send back "on" or "off" as status.
There are no issues when I use tera term.
By the way this is the device I am trying to talk to
https://beyondmeasure.rigoltech.com/acton/attachment/1579/f-03a1/1/-/-/-/-/DP800%20Programming%20Guide.pdf
It works with Serial.readString() 
system
Closed
5
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.