• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
March 29, 2024, 09:55:47 am

News:

SMF - Just Installed!


General Problem with RTS ?

Started by moelski, April 20, 2011, 07:49:13 am

Previous topic - Next topic

moelski

April 20, 2011, 07:49:13 am Last Edit: April 20, 2011, 07:53:10 am by moelski
Hi Roman,

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

Using this code:
        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

moelski

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

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

Ok setting and Resetting RTS is OK with 3.3.0.12  :)