Send and receive

Started by lopezan, December 10, 2013, 03:30:14 pm

Previous topic - Next topic

lopezan

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

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

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

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

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

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

Hello,
if I send more data to the HID device, the report ID have to change anytime I send data?

lopezan

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?