Author Topic: Send and receive  (Read 1088 times)

lopezan

  • Newbie
  • *
  • Posts: 10
    • View Profile
Send and receive
« on: December 10, 2013, 04:30:14 pm »
Hello,

I'm new with nrcomm and I'm trying it before to purchase.
I need to send data to a HID device and wait that the device send some confirmation data.
How can I implement this procedure?

Regards.

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Send and receive
« Reply #1 on: December 11, 2013, 09:54:25 am »
Hello

If your device supports any data transfer protocol you need implement them.
nrComm Lb includes solution for Modbus, ASTM protocols.
Also you can implement any original protocol with TnrDataProcessor component (see Demos\DataProc\dataproc.dpr sample)

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

lopezan

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Send and receive
« Reply #2 on: December 11, 2013, 11:33:42 am »
Hello,

but can I use the SendString method to send data and the OnAfterReceive event to read data sent by the device?

Regards.
Angelo

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Send and receive
« Reply #3 on: December 11, 2013, 11:37:49 am »
Hello

Yes of course.
You can take a look at HIDDemo sources. It does same.

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

lopezan

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Send and receive
« Reply #4 on: December 16, 2013, 03:47:26 pm »
Hello,
please, could you help me? Demo isn't more clear for me. I'm beginner with communications control.
I have to send an ASCII fixed length string.
I haven't understood the OutputReportLength method.
How can I do?

Thanks and regards.

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Send and receive
« Reply #5 on: December 17, 2013, 07:03:32 am »
Hello

Usual HID device expects the exact length of data.
The exact fixed length is available in OutputReportLength property.
If your data length lower than OutputReportLength you need add necessary length.
First char is report ID.

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

lopezan

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Send and receive
« Reply #6 on: January 15, 2014, 12:24:36 pm »
Hello,
if I send more data to the HID device, the report ID have to change anytime I send data?

lopezan

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Send and receive
« Reply #7 on: January 15, 2014, 03:21:17 pm »
I'm trying your product to see if it's useful for my project.
I have to do this steps:

- I read data from a table of a sqlite db.
- I send data to HID device
- When I send data, I wait to receive a response from HID device with a checksum
- I loop the send and receive until EOF table.

How can I do this?