Results 1 to 8 of 8

Thread: SerialPort Low Level Settings?

  1. #1

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    384

    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.

  2. #2
    Frenzied Member
    Join Date
    May 2014
    Location
    Central Europe
    Posts
    1,388

    Re: SerialPort Low Level Settings?

    ControlHandshake 0x01
    Xonlimit 100
    Xofflimit 100
    may indicate that you need to set your serialport.Handshake property to XonOff

  3. #3

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    384

    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? :'(

  4. #4

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    384

    Re: SerialPort Low Level Settings?

    Quote Originally Posted by digitalShaman View Post
    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.

  5. #5
    Frenzied Member
    Join Date
    May 2014
    Location
    Central Europe
    Posts
    1,388

    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..)

  6. #6

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    384

    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 View Post
    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 ]

  7. #7

    Thread Starter
    Hyperactive Member pourkascheff's Avatar
    Join Date
    Apr 2020
    Location
    LocalHost
    Posts
    384

    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.

  8. #8
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: SerialPort Low Level Settings?

    What exactly is 'HART DEVICE'? It is strange that you are using flow control.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

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
  •  



Click Here to Expand Forum to Full Width