Author Topic: Putting #$ Auto After Hex  (Read 930 times)

siliconin

  • Newbie
  • *
  • Posts: 8
    • View Profile
Putting #$ Auto After Hex
« on: August 03, 2011, 07:59:28 am »
Hello,
i am new currently trying demo of nrcomm i want to know if i need to send large string's like
7E A0 72 55 7E 00 00     may b more large i need to put manually #$
eg -  7E#$A0#$72#$55#$7E#$00#$00

is their any software that can do it auto as i just need to put data output should b wih #$

waiting for reply
thanks

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Putting #$ Auto After Hex
« Reply #1 on: August 03, 2011, 10:54:51 am »
Hello

Possible I don't understand you, but it seems like your question is not related with nrComm Lib.

If you want to send binary data from memory buffer, you can use SendData() methods instead SendString().

If you need to include into your source code string constants with HEX codes, you can use COPY/PASTE,  Replace in Block of text editor (replace space on #$).

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.

siliconin

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Putting #$ Auto After Hex
« Reply #2 on: August 03, 2011, 11:44:44 am »
Hello,
thanx for reply
i like nrcomm much its initialized and working properly sending data also but the problem in i need to send large data and on data i need to put #$ manually after hex
#$7F#$7A#$7e
I JUST WANT TO KNOW ANY EASY METHOD TO PUT #$ ?
can u give demo how to send data through nrcomm1.senddata?

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Putting #$ Auto After Hex
« Reply #3 on: August 04, 2011, 06:08:51 am »
Hello

The #$ chars are needed for compiler when you type HEX char codes into string constants into source code.

SendData can be used like following:

Code: [Select]
var
  dataBuffer:PAnsiChar;
  len:integer;
begin

  len := 3;
  dataBuffer := StrAlloc(len);

  dataBuffer[0] := $7F;
  dataBuffer[1] := $7A;
  dataBuffer[2] := $7E;

  nrComm1.SendData(dataBuffer, len);

end;

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.