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

Stucked With SendData

Started by siliconin, September 26, 2011, 04:56:10 am

Previous topic - Next topic

siliconin

Hi,
i am trying to send some data to serial using nrcomm1.senddata();
data need to send is

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

Hello

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


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.