Author Topic: General Problem with RTS ?  (Read 1480 times)

moelski

  • Full Member
  • ***
  • Posts: 122
    • View Profile
General Problem with RTS ?
« on: April 20, 2011, 10:49:13 am »
Hi Roman,

I´m testing RS485 at the moment and its really strange with nrcomm and SerialPort (from .net).

Using this code:
Code: [Select]
        private void button1_Click(object sender, EventArgs e)
        {
            //nrComm1.SetStateRTS(false);
            byte[] buffer = new byte[] { 0x30, 0x31, 0x3E, 0x3F, 0x40, 0x41, 0x30 };
            nrComm1.Write(buffer, 0, buffer.Length);
            //nrComm1.SetStateRTS(true);
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            //nrComm1.Protocol = StreamProtocol.None;
            //nrComm1.RS485Mode = true;
            nrComm1.Active = !nrComm1.Active;
            nrComm1.SetStateRTS(true);
        }

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox2.Checked)
                nrComm1.SetStateRTS(true);
            else
                nrComm1.SetStateRTS(false);
        }
I got only NUL in my Terminal.

If I send data from an "old" Delphi Terminal and control RTS by myself I got data transmitted over RS485.

But I can´t get it working with nrcomm (and also not woth SerialPort from .net).

There is one thing I really don´t understand, too...
If I switch the RTS line between set / reset I got a feedback in my listening terminal in BOTH cases.
No matter is RTS is set or not.  :P

Is there any general problem with controlling the RTS / DTR lines in .NET ?

Greetz Dominik
« Last Edit: April 20, 2011, 10:53:10 am by moelski »

moelski

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Re: General Problem with RTS ?
« Reply #1 on: April 20, 2011, 06:54:18 pm »
Hi Roman,

I put an Digital Multimeter to the RTS pin and it is always at 3,3v.
If I set or Reset RTS nothing happens to the Voltage !

So I think there is a general problem with setting and resetting RTS !

I doublechecked that with the normal .NET serialPort. Here it works. Set = 3,3V and reset = 0V. (At my USB/Serial Converter).
And an old Delphi Terminal is also able to set / reset RTS.
It must be a nrcomm Problem.

DTR is working fine.

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: General Problem with RTS ?
« Reply #2 on: April 21, 2011, 12:45:01 pm »
Hello

Please try to use portmon or something like for monitor serial port changes.
Also please check that Protocol property is set in None.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

moelski

  • Full Member
  • ***
  • Posts: 122
    • View Profile
Re: General Problem with RTS ?
« Reply #3 on: April 22, 2011, 04:25:43 am »
Ok setting and Resetting RTS is OK with 3.3.0.12  :)