Author Topic: print 8 bit hex number  (Read 5862 times)

GMG

  • Newbie
  • *
  • Posts: 3
  • I'm a llama!
    • View Profile
print 8 bit hex number
« on: October 21, 2004, 09:27:00 AM »
I am sending following HEX string E0 A5 E0 FB 00  to RS232 port
 00 is Interger A and must be 8 bit HEX number. I use interger A for counting. Following PRINT command works ok but not the last part
CHR$(A)

PRINT #1 CHR$(&HE0);CHR$(&HA5);CHR$(&HE0);CHR$(&HFB);CHR$(A);

I am using this to display counting on a 7 segment display with RS232 port.
Interger A does not show the right number, why is that ?
The RS232 7 segment display use the following input format
&HE0,&HA5,&HE0,&HFB,HIGH_BYTE,LOW_BYTE
The interger A should go to HIGH_BYTE,LOW_BYTE




« Last Edit: October 21, 2004, 10:51:46 AM by GMG »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:print 8 bit hex number
« Reply #1 on: October 22, 2004, 11:52:00 AM »
PRINT command assuming that the string is terminated by the null character (ASCII 0) so CHR$(0) will not work with PRINT command.

You should use the OUTCOMM command to send out the the binary data to your device.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS