Author Topic: Stucked With SendData  (Read 1057 times)

siliconin

  • Newbie
  • *
  • Posts: 8
    • View Profile
Stucked With SendData
« on: September 26, 2011, 07:56:10 am »
Hi,
i am trying to send some data to serial using nrcomm1.senddata();
data need to send is
Code: [Select]
array[1..136] of byte=(
$26, $52, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $71, $F6, $7E);

i am trying as mentioned in your post but every time fails :-[
http://forums.nrcommlib.com/index.php?topic=1253.0

i can send all my data sendstring it works like a charm but need to send using send data and stucked here can please make a demo of my code so it would be easy to understand for me
thanks
slilicon



pls make a demo for send data

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Stucked With SendData
« Reply #1 on: September 26, 2011, 08:45:15 am »
Hello

We have modified Codes demo.
Please add new button and following click handler:

Code: [Select]
var data: array[1..136] of byte = (
$26, $52, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
 $00, $00, $00, $00, $00, $71, $F6, $7E);

procedure TForm1.Button2Click(Sender: TObject);
begin
  nrCOmm1.SendData(@data[1], 137);
end;


All works fine.

Please note that better if you select StreamProtocol spHardware for avoid problems with control chars.

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.