Author Topic: Connect, send questions  (Read 2935 times)

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Connect, send questions
« Reply #15 on: May 19, 2011, 03:00:22 pm »
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

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Connect, send questions
« Reply #16 on: May 19, 2011, 05:21:02 pm »
Here it is.

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Connect, send questions
« Reply #17 on: May 19, 2011, 05:31:29 pm »
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

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Connect, send questions
« Reply #18 on: May 20, 2011, 02:30:58 pm »
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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Connect, send questions
« Reply #19 on: May 21, 2011, 05:42:00 am »
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

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Connect, send questions
« Reply #20 on: May 21, 2011, 03:45:59 pm »
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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Connect, send questions
« Reply #21 on: May 21, 2011, 05:25:59 pm »
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

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Connect, send questions
« Reply #22 on: May 22, 2011, 02:06:40 am »
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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Connect, send questions
« Reply #23 on: May 22, 2011, 05:56:44 am »
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:

Code: [Select]
    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:

Code: [Select]
SerialPort.ComPortNo := 1; // for COM1
Roman Novgorodov
DeepSoftware
« Last Edit: May 22, 2011, 06:02:26 am by Roman Novgorodov »
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

Mike

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Connect, send questions
« Reply #24 on: May 23, 2011, 09:00:36 pm »
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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Connect, send questions
« Reply #25 on: May 24, 2011, 04:44:54 am »
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

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Connect, send questions
« Reply #26 on: May 24, 2011, 02:09:19 pm »
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)