SPLat Logo

Formatting functions

NOTICE: Our web site is being updated, but is currently experiencing extreme slowness due to host issues. Please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map
SPLat will be shut down for the Christmas Holiday season from Friday 20 December 2024 through Tuesday 7 January 2025. We will check emails periodically and will continue to process orders but at a slower pace. Santa hat

Formatting functions

Formatting functions are a way of specifying data memory (RAM) variables or register contents as arguments in hash functions. Some examples:


#HMI ButtonEvent2( id:b(*Foo), t:("Count=", b(=x) ) ;Fetch RAM byte (8-bit) variable Foo and use as the id, change the button text to "Count=nnn"

#HMI Print( f(*fTherm,5,1), "°C" ) ;Fetch RAM floating point variable fTherm and print as "nnn.n°C"

#HMI Print( "Threshold: ", b(=x), "%") ;Print the byte (8-bit) value in X as "Threshold: nnn%"

The first and last of the above use the b() formatting function. The second one uses the f() formatting function.

Formatting functions are supported only by HMI related hash functions. They give you a powerful and flexible way of programmatically controlling the display. Each hash function's page states explicitly if it supports formatting functions.

Note that these formatting functions apply to most (but not necessarily all) of the parameters of the HMI hash functions.

Restrictions:

  1. #EQU values cannot be used inside formatting functions.