08-05-2014 03:25 AM - edited 08-05-2014 03:30 AM
Hi, everybody!
I have an engine and I want to control it by means of rs485.
wData = new SerialSession("COM7"); wData.BaudRate = 9600; wData.TerminationCharacterEnabled = true; String Command = "AV10000"+"\r"; byte[] bytes = new byte[8]; int bWritten = ASCIIEncoding.ASCII.GetBytes(Command, 0, Command.Length, bytes, 0); wData.Write(bytes); wData.Clear();
through visa and c# there is no response
Problem is "#0D" but I send it through "\r"
Through the terminal program everything works
08-05-2014 07:55 AM
@mell90 wrote:
Hi, everybody!
I have an engine and I want to control it by means of rs485.
wData = new SerialSession("COM7"); wData.BaudRate = 9600; wData.TerminationCharacterEnabled = true; String Command = "AV10000"+"\r"; byte[] bytes = new byte[8]; int bWritten = ASCIIEncoding.ASCII.GetBytes(Command, 0, Command.Length, bytes, 0); wData.Write(bytes); wData.Clear();through visa and c# there is no response
Problem is "#0D" but I send it through "\r"
If you know that you need to send #0D why are you deliberately sending \r ?
08-05-2014 07:58 AM
Because in this case it sends "#0D" as a string and the engine to it doesn't react
08-05-2014 09:35 AM
@mell90 wrote:
Because in this case it sends "#0D" as a string and the engine to it doesn't react
And what does the engine documentation says needs to be sent?
08-05-2014 10:30 AM
For example "AV10000" + "carriage return"
via the terminal on the second picture I send
via the serialport c# it works also goog but not with VISA
serialPort.Write("AV10000\r");