Skip to content

ViSi-Genie Magic: Custom Gauges using Predefined Images

Introduction

This codebase example demonstrates how an external host interacts with a custom gauge object on the display module. A display module loaded with a ViSi-Genie program follows the Genie Standard Protocol when it sends and receives messages to and from an external host. The protocol utilizes only a handful of commands and is simple and easy to implement. This codebase example demonstrates the use of some of these commands when interacting with a custom gauge object.

The custom gauge object used in this codebase example is actually a user button object, the behavior of which was slightly modified to make it behave more like a knob or a rotary switch. The behavior was modified using magic objects. The frames of the custom gauge object were generated using ImageMagick®.

The display module used in this example is the uLCD-32PTU. The host applications used are the GTX Tool and the Serial Terminal running on the PC. The GTX tool and the Serial Terminal are utilities inside the Workshop4 IDE.

Note

Workshop4 Pro is needed for this code example.

Part I (Optional) : Use ImageMagick to generate the frames for the custom gauge.


Part II : Main Part

Prerequisites

This codebase example assumes the reader can program the 4D Systems display module using Worksho 4 IDE ViSi-Genie environment. Beginners are advised to read the following aplication notes.

Furthermore, the reader must already know how to use the user button object in ViSi-Genie. Recommended application notes that may help the reader in understanding how the user button object works are:

Lastly, the reader must already be acquainted with the Magic Objects. Below are the magic objects used in this codebase example. Relevant application notes and/or codebase examples are also listed.

Magic Object Relevant Application Note(s) or Codebase Example(s)
Introduction to Magic Objects ViSi-Genie: How to Add Magic Objects
Magic Code ViSi-Genie: Magic Code Insertion Points
Magic Code ViSi-Genie: Magic Main Loop Counter
Magic Move ViSi-Genie: Magic Custom Slider
Magic Release ViSi-Genie: Magic BeepBop
Magic Release ViSi-Genie: Magic Exit Genie
Magic Touch ViSi-Genie: Magic BeepBop

Instructions

Follow the procedures below to run this example. The reader is also advised to watch the accompanying videos. Part I is optional. It shows how the frames of the custom gauge object were generated.

Part I (Optional) : Use ImageMagick to generate the frames for the custom gauge

  1. Download and install ImageMagick® for Windows from their website or build your own from their GitHub repository. Make sure that the software is properly installed.
  2. Open the attached folder "Images and Scripts".
  3. Watch the Part I video for further instructions.

If you wish to learn how to create a user button project in ViSi-Genie, see the application note ViSi-Genie: User Button.

Part II : Main Part

  1. Extract the content/s of the Workshop4 Project zip file to a folder.
  2. Open the project in Workshop.
  3. Compile the project source code and download or upload the program to the target display module (a uLCD-32PTU in this codebase example). Let Workshop copy the supporting files to a uSD card mounted to the PC.
  4. Properly unmount the uSD card from the PC and mount it to the uLCD-32PTU.
  5. Open the GTX tool of the Workshop4 IDE.
  6. Watch the Part II video for further instructions.

Attachment

Project File