• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

Connect, send questions

Started by Mike, May 16, 2011, 10:16:06 am

Previous topic - Next topic

Roman Novgorodov

Hello Mike

At first view, it seems like your info was correct. I see such commands in PDF.

Please upload portmon LOG of success session between your good app and device.
I want to look at real data communication.

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

Mike


Roman Novgorodov

Mike, you uploaded file with zero size.
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

Mike

Oops  :-[

For some reason, Portmon isn't writing anything to the file when Log to File is clicked, although it does create the file. I have to do a save.

This one has content.

Roman Novgorodov

Hello

Thank you for LOG file.

Your k3test has different settings for stream protocol of serial port.
You can run demo v2 and try to click "..." and change protocol from Hardware to None and try "Connect" again.

I don not see where PDF describes serial port mode settings.

Possible device waits RTS/DTR changing, in this case please try new demo v3 from attachment and play with new checkboxes.

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

Mike

Success, Roman!

With protocol set to none, the demo it works. There is something else wrong tho, as my code does not work. Can I see your source?

After a sleep(1000); I check ReadyForRead and after the baud rate changes to 19200, it returns 2. The baud should be  9600 in this case. 

The port settings are described in the user's manual (also available on-line). They are: data = 8, parity = none, stop bits = 1. DTR/RTS are not used for handshaking.

Roman Novgorodov

Hello Mike

Thank you for good information. Your patience is good too.

Please see sources of demo v3 in attachment.

I used most suitable and quick way (for me) for resolve your task.
There are some comments in source, possible they help you understand all.

Don't miss to look at nrDataProcessor1.DataPackets property at design time (object inspector)

You can add here any other packet described in documentation and catch them in nrDataProcessor1DataPacket event handler.

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

Mike

Roman, thanks. Your solution is elegant.

I tried incorporating your code into my project, and cannot get a connection established. I think I have missed something about nrDataProcessor1.DataPackets property. I don't understand how that works. Does one have to be defined for each command sent to the radio? There are over 100 commands, and some strings sent from the radio to the PC are not initiated by a PC command to the radio.

I'm using the same two you defined, but the nrDataProcessor1DataPacket procedure doesn't fire.

I also don't see where you assign the port, but I guess it gets done when the port is selected in the dropdown.

I've attached a zip of my project, if you could take a look.

Roman Novgorodov

May 22, 2011, 02:56:44 am #23 Last Edit: May 22, 2011, 03:02:26 am by Roman Novgorodov
Hello

It seems like you missed fill packets setting.
Please understand that nrDataProcessor1 need to know which chars at begin and which chars at end of awaiting packets for correct detection them.

My demo contains following options:

    nrDataProcessor1.DataPackets[0] =
        Active = True
        ResetOthers = True
        Caption = 'AI2 packet'
        PacketBegin = 'AI2'              /// <- !!!!!!!!!!!!!!!!!!!!!! you miss this!
        PacketEnd = ';'                     /// <- !!!!!!!!!!!!!!!!!!!!!  you miss this !
        PacketLength = 0
        PacketEndByTimeout = False
        Tag = 0
     end

      nrDataProcessor1.DataPackets[1] =
        Active = True
        ResetOthers = True
        Caption = 'IF packet'
        PacketBegin = 'IF'                  /// <- !!!!!!!!!!!!!!!!!!!!!!  you miss this !
        PacketEnd = ';'                      /// <- !!!!!!!!!!!!!!!!!!!!!!  you miss this !
        PacketLength = 0
        PacketEndByTimeout = False
        Tag = 0
      end


The port number is selecting in attached TnrDeviceBox control (combo box)
If you need set it at runtime you can use something like this:

SerialPort.ComPortNo := 1; // for COM1

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

Mike

Thanks, Roman.

I hate it when I miss stuff like that. A bit of a mention in the help file would be good.

I also need to come up with a method for confirming a connection using the onAfterReceive.

I think I'm convinced enough to buy, but I'm confused. Primus lists the basic license at $69.00 USD. Share-it has the same license for $107.78 USD. $69.00 is a lot more attractive, of course...... ;D


Roman Novgorodov

Hello

Yes, documentation of library is poor, but context help contains some info about PacketBegin and PacketEnd properties.
Also some additional info is available here:
http://www.deepsoftware.com/nrcomm/tnrdataproc.html

About pricing. ShareIt bases on Euro, Plimus uses USD. You can choose any.

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

Mike

Re: pricing. They both say USD.  Despite what you think it is doing, one of them is wrong. Go look.

Context help is good, better with source code. NOTHING takes the place of and adds value to a product like good documentation and examples.   ;D

The link had some good info, is there a way to find small gems like that on the website?

On a positive note, I'm impressed by your help here. I'm buying.  8)