SerialPort Low Level Settings?
Hi all. :wave:
Mimicking a RS-232 communication with a specific device is desired.
General settings (Baud rate, Parity, Handshake, Word length and other properties grid provided) were done and confirmed that they're OK. A correct sequence of request command was applied through the port but no answers were received.
After monitoring what's happening on the port, found that some settings were different in spite of "general" (some-say) settings are matched. Different subitems are as following:
Code:
---------------
Eofchar 0
Errorchar 0
Breakchar 0
Eventchar 0
Xonchar 17
Xoffchar 19
---------------
Flags=0x0000000F
---------------
ControlHandshake 0x01
Flowreplace 0x00
Xonlimit 100
Xofflimit 100
---------------
The question is how to access and change their values to desirable values?
Is it even possible? Should I renew my V.S.? I gathered some articles in different forums (even here) but nothing operational were catch.
All mentioned parameters are not members of 'System.IO.Ports.SerialPort'. Maybe you could introduce me a way to achieve a kind of low level accessibility.
Thanks in advance.
Re: SerialPort Low Level Settings?
Quote:
ControlHandshake 0x01
Xonlimit 100
Xofflimit 100
may indicate that you need to set your serialport.Handshake property to XonOff
Re: SerialPort Low Level Settings?
/CRITICAL HOTFIX/
It should be noted that interface is a FT232RL chip based which make COM port via USB port possible but different structure is rare.
Do I have to write a serial communication library from scratch? :'(
Re: SerialPort Low Level Settings?
Quote:
Originally Posted by
digitalShaman
may indicate that you need to set your serialport.Handshake property to XonOff
Hey there. SerialPort1.Handshake=XonXoff makes these differences:
Code:
ControlHandshake 0x01 (DTR Enabled will correct this)
FlowReplace 0x03 (Should be 0x00 Take action directly from handshake property)
XonLimit 1024 (Should be 100)
XoffLimit 1024 (Should be 100)
FlowReplace will be 0x00 (correct value) if SerialPort1.Handshake=None. Required parameters to access can be simplified as
EofChar
EventChar
XonLimit
XoffLimit
:)
Re: SerialPort Low Level Settings?
i understood that the config you posted was from your device?
tip: try to get the connection working in some serial console first where you can easily play around with settings and can be sure that it's not a bug in your program (haven't done this for years and back then, there was some tool included in windows, cant remember its name... not sure what you would use today..)
Re: SerialPort Low Level Settings?
Yes, Correct connection was established and these settings were spied. These are desirable. Current ones are different and not changeable via SerialPort property grid.
Quote:
Originally Posted by
pourkascheff
Code:
---------------
Eofchar 0
Errorchar 0
Breakchar 0
Eventchar 0
Xonchar 17
Xoffchar 19
---------------
Flags=0x0000000F
---------------
ControlHandshake 0x01
Flowreplace 0x00
Xonlimit 100
Xofflimit 100
---------------
Scheme:
PC (COM4) [ USB ]---[ INTERFACE ]---[ HART DEVICE ]
Re: SerialPort Low Level Settings?
How about MFCs? Microsoft foundation/fundamental classes (I just heard. Nothing practical)
Re: SerialPort Low Level Settings?
What exactly is 'HART DEVICE'? It is strange that you are using flow control.