SPLat Logo

HMI - Image rotation

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

HMI - Image rotation

The HMI is capable of rotating an image and here's what the example will do, presented for your viewing pleasure an an animated gif:

Gauge with rotating needle

We suggest using this feature sparingly because it will greatly slow your controller down.  The smaller the image the faster it will render.

Here's the code that displays the two images:


#HMI DrawImage( x:131px, y:26px, i:"gauge.png" ) ;draw the gauge
#HMI DrawImage( id:0, x:177px, y:100px, i:"needle_grn.png", z:65, ox:63, oy:36 );draw the dial, note the z index places the dial on top of the gauge

There are a few key elements to making this work:

And here's the code that actually rotates the needle (and in this case, chooses the yellow version):


#HMI DrawImage( id:0, i:"needle_ylw.png", ro:f(*fAngle) )

The full source code and images for this demo is available here:

Download gauge.zip