Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
544 views
in Technique[技术] by (71.8m points)

serial port - programming aoip om21 rs232 with dotnet

I try to communicate with measurement device Om21 from Aoip, but I have some difficulties. It's pretty old equipment which is used by the serial port

I can send command to it but I can't receive information from it

i try this :

 var _serialPort = new SerialPort {BaudRate = 9600, ReadTimeout = 4000, WriteTimeout = 4000, ReadBufferSize = 128, WriteBufferSize = 128};
_serialPort.Open();                  // ok
_serialPort.Write("REM
");          // ok     
_serialPort.Write("KEYB OFF
");     // ok             
_serialPort.Write("CL_ERR
");       // ok          
_serialPort.Write("LIGHT ON
");     // ok            
_serialPort.Write("CYCLE 1
");      // ok           
_serialPort.Write("MEAS_RT OFF
");  // ok     
_serialPort.Write("RANGE AUTO
");   // ok              
_serialPort.Write("*WAI
");         // ok     
     
_serialPort.Write("*IDN?
");        

// what write here to receive info ? 

Someone have a idea ?

IEEE-488 mode Responses to queries are stored in a memory zone called anoutput buffer waiting till they are read by the controller. The outputbuffer holds up to 128 eight-bit bytes.As soon as the unit is set to talk mode by the controller, thecontents of the output buffer are sent over the bus, then once thewhole of the response message has been received by
thecontroller, the response terminator ( + EOI) is sent over thebus.

RS 232 mode: The output buffer works in the same way, except for the followingdetails:- In either protocol mode, the DTR line must be forced high beforethe serial interface can send characters.- The interface only starts sending responses once the output bufferis full or a command message terminator has been decoded.- In XON/XOFF protocol, the interface stops transmitting as soon asa Control/S (XOFF) has been received, and restarts transmittingas soon as a Control/Q (XON) has been received.

question from:https://stackoverflow.com/questions/65920626/programming-aoip-om21-rs232-with-dotnet

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...