Knowledge Base

# HexVar(bArg) hash function

Valid for use with hash commands: HMI, HMI_Trace, and HMI_Log

Implemented on the following platforms: HMi430, Android, Windows

This is an old function. Print is newer and shinier. With formatting functions it can do what this one does, and a lot more.

This function will cause the 8-bit number stored in RAM at location bArg to be output in hexadecimal format in a field width of 2 characters. The formatting is identical to OBLCD_HexDispX

Example:

The following program will generate a running 8-bit hexadecimal count in the top lefthand corner of the SimpleHMI screen.

(Click here for some tips for working around problems with copy and paste out of Internet Explorer and HTML-help (.chm) files)

# Open_Serial User(38400,8,N)    
on 0
LaunchTask HexCount ;Task that generates count
RunTasksForever

bHexNum: defBYTE
RunTime:
Pause 100 ;1S delay
IncM bHexNum
# HMI Cursor(0,0) SetFGColour(0,0,255) SetBGColor(255,255,255) Print(" ") HexVar(bHexNum) Text(" ")

GoTo RunTime

The hash command Open_Serial is documented elsewhere. Here it simply opens the serial port for use with a user defined protocol at 38400 Baud.