06-11-2010 06:16 AM
Hello,
I am building a test setup which includes Agilent E3631A power supply connected via serial port.
We use MS Visual Studio C# for programming our test apps.
Some settings of E3631A serial port are fixed - number of stop bits (2), and hardware flow control(DTR/DSR).
Using correct serial port setting I can access the instrument from MAX and Hyperterminal,
but our C# app sometimes gets "Query interrupted" and "RS-232 framing error".
It seems that it has to do with how Agilent driver configures serial port -
this is what I see in AgilentE3xxxClass.IO.IO.OptionString (which is read only):
BaudRate=9600; .. FlowControl=ASRL_FLOW_NONE; .. StopBits=ASRL_STOP_ONE;
I expected the serial port would be the the same I set in MAX, but it's obviously not the case.
How do I configure serial port in Visual Studio apps?
Best regards,
Yuriy Olkhovyy
06-11-2010 06:37 AM
Ok, I've found this:
http://forums.ni.com/ni/board/message?board.id=140&message.id=15297&query.id=9245302
So I can set stop bits to ASRL_STOP_TWO and flow control to ASRL_FLOW_DTR_DSR -
tt works fine but at the end I need to call AgilentE36xxClass.Initialize(), and after this the
serial port stop bits and flow control are set back to ASRL_STOP_ONE adn ASRL_FLOW_NONE.