SPLat Logo

# fDispW(f, p) hash function

NOTICE: We are updating our website. For product enquiries and orders please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

# fDispW(f, p) 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 floating point number in W to be output in a field width of f characters total, including p digits after the decimal point. The formatting is identical to OBLCD_fDisp.

Example:

The following program will generate a running time display in the top lefthand corner of the SimpleHMI.

(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      RunTime        ;Task that generates the running time
        RunTasksForever

fRunningTime:           defFLOAT       ;Used to count up seconds
RunTime:
        Pause 100                      ;1S delay  
        fRecallW        fRunningTime   ;Increment the counter ...
        fInc
        fStore          fRunningTime
# HMI Cursor(0,0) SetFGColour(255,0,0) SetBGColor(0,255,255) fDispW(5,0) Print(" ")
        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.