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

XE4 Sending hex codes

Started by Fletch, June 10, 2013, 11:57:42 am

Previous topic - Next topic

Fletch

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.

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


or

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

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:

  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.