• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
March 29, 2024, 08:34:40 am

News:

SMF - Just Installed!


OnDataSend not workin

Started by moelski, April 21, 2011, 02:04:56 am

Previous topic - Next topic

moelski

April 21, 2011, 02:04:56 am Last Edit: April 21, 2011, 02:54:03 am by moelski
Hi Roman,

I´m just trying to get my RS485 stuff working but I think there is another problem.
I placed some code in the eventhandler for OnDataSend:
        private void nrComm1_OnDataSent(object sender, EventArgs e)
        {
         //   Thread.Sleep(100);
            nrComm1.SetStateDTR(true);
        }


I set a breakpoint on SetSta..... in VS2010. If I send some data the compiler don´t stop there ...

And my Device monitor Studio tells me nothing about setting DTR:
Quote091010: Write Request (DOWN), 21.04.2011 07:01:07.541 +0.003
Buffer size: 0x7 bytes
30 31 3E 3F 40 41 30                              01>?@A0
091012: I/O Request (DOWN), 21.04.2011 07:01:09.145 +1.603
IOCTL_SERIAL_CLR_DTR: Clear DTR

091013: I/O Request (UP), 21.04.2011 07:01:09.145 +0.0
IOCTL_SERIAL_CLR_DTR: Clear DTR

091014: Write Request (DOWN), 21.04.2011 07:01:09.145 +0.0
Buffer size: 0x7 bytes
30 31 3E 3F 40 41                                 01>?@A


So I think the eventhandler is never used after data send  :(

Roman Novgorodov

Hello

Please download newest release 3.3.0.12
Now OnDataSend works more correctly.

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

Hi !

I´m sorry to say that but it´s not working.

The eventhandler is set:
this.nrComm1.OnDataSent += new System.EventHandler(this.nrComm1_OnDataSent);

Port is configured:
            nrComm1.Protocol = StreamProtocol.None;
            nrComm1.RS485Mode = RS485Modes.DTRLow;
            nrComm1.Active = !nrComm1.Active;
            nrComm1.Parity = Parity.Even;


Eventhandler is present:
Quoteprivate void nrComm1_OnDataSent(object sender, EventArgs e)
        {
         //   Thread.Sleep(100);
            MessageBox.Show("OnDataSend");
            nrComm1.SetStateDTR(true);
        }


And nothing happens after sending Data.

:o

Roman Novgorodov

Hello

It's strange.
OnDataSend event works correctly on our machines.

We tested following code:

        private void nrComm1_OnDataSent(object sender, EventArgs e)
        {
            Debug.WriteLine("Buffer is empty ... ");
        }

Please check that you installed newest version of nrComm Lib.

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

Hi Roman,

QuoteIt's strange.

Indeed...

How can I check the version? I´ve downloaded the latest installer and it was 3.3.0.12.
I uninstalled the previous release and installed the new one.


Roman Novgorodov

Hello

Yes, this version is correct.

Please check that MonitorThreadMode has Enable value.

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

Hi Roman,

QuoteMonitorThreadMode has Enable value

Ok that works. But it´s hard to understand why this option has to be set.
The help file is actually only describing the function but don´t give any additional hints like this one.

When do you think the helpfile is as useful as the Delphi one?

Greetz
   Dominik

Roman Novgorodov

Hello

Yes, you are right. Included context help is poor.


My English is bad but I try to explain more details about this property.

MonitorThreadMode controls internal nrComm component thread.
This thread monitors state of serial port (data receiving, signal changes, buffer empty etc.)
If something happens, thread calls needed event (delegate) and calls internal methods for change states of assigned terminals or data processor components.
Thread can be enabled or disabled.
In auto mode, thread will be enabled only if terminal or data processor is assigned to nrComm.

We will try to add more description into library documentation.

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

Hi !

QuoteMy English is bad

Even if your english is bad ... That exlanation would be ok for most users  ;)
btw. My english is not better  ;D

QuoteWe will try to add more description into library documentation.

That would be really great. Just some basic examples with a little bit of information.
It´s enough for the most things.