Author Topic: XE4 Sending hex codes  (Read 1471 times)

Fletch

  • Newbie
  • *
  • Posts: 29
    • View Profile
XE4 Sending hex codes
« on: June 10, 2013, 02:57:42 pm »
Hi

I am having trouble sending hex codes to a pos pole display from Delphi XE4.

The pole display codes are 1B 46 41[DISPLAY MESSAGE] 0D.  This should display the message on the 1st line of the display.

I can send this via a serial port program and all works fine, but when I try and send it from Delphi the pole display
ignores the hex control codes.  Tried the following code.

Code: [Select]
nrComm1.SendString(#$1B#$46#$41);
    nrComm1.SendString('TEST DISPLAY MESSAGE');
    nrComm1.SendString(#$0B);

or

Code: [Select]
nrComm1.SendString(#$1B#$46#$41+'TEST DISPLAY MESSAGE'+#$0B);
I can send just the message text and the pole display shows it, but I have no control of where and how it displays.  The
control codes tell it whether it must display text on line 1 or 2 etc

This used to work but now it does not.  Is it possibly XE4?

Thanks


Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: XE4 Sending hex codes
« Reply #1 on: August 30, 2013, 06:06:48 am »
Hello

You need check serial port settings.
Possible XOnn/xOff stream protocol handles some HEX numbers.
You can set spNone or spHardware and try again.

Also possible your device need timeout between control chars and text string. Try following:
Code: [Select]

  nrComm1.SendString(#$1B#$46#$41);
  Sleep(100);
  nrComm1.SendString('TEST DISPLAY MESSAGE');
  Sleep(100);
  nrComm1.SendString(#$0B);

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.