|
-
Jul 18th, 2021, 04:39 AM
#1
Thread Starter
Hyperactive Member
SerialPort Low Level Settings?
Hi all. 
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.
Last edited by pourkascheff; Jul 18th, 2021 at 04:49 AM.
-
Jul 18th, 2021, 04:51 AM
#2
Re: SerialPort Low Level Settings?
ControlHandshake 0x01
Xonlimit 100
Xofflimit 100
may indicate that you need to set your serialport.Handshake property to XonOff
-
Jul 18th, 2021, 05:02 AM
#3
Thread Starter
Hyperactive Member
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? :'(
-
Jul 18th, 2021, 05:10 AM
#4
Thread Starter
Hyperactive Member
Re: SerialPort Low Level Settings?
 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
Last edited by pourkascheff; Jul 18th, 2021 at 05:14 AM.
-
Jul 18th, 2021, 05:16 AM
#5
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..)
-
Jul 18th, 2021, 05:28 AM
#6
Thread Starter
Hyperactive Member
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.
 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 ]
-
Jul 18th, 2021, 07:23 AM
#7
Thread Starter
Hyperactive Member
Re: SerialPort Low Level Settings?
How about MFCs? Microsoft foundation/fundamental classes (I just heard. Nothing practical)
Last edited by pourkascheff; Jul 19th, 2021 at 02:55 AM.
-
Jul 20th, 2021, 07:58 AM
#8
Re: SerialPort Low Level Settings?
What exactly is 'HART DEVICE'? It is strange that you are using flow control.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|