ViSi-Genie GTX The Slider Object

4D Systems Codebase Example

Introduction


Setup

This codebase example demonstrates how an external host interacts with slider objects 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 focuses on demonstrating the use of some of these commands when interacting with slider objects.

The display module used in this example is the uLCD-32PTU. The host used is the GTX Tool running on a PC. The GTX tool is a utility inside the Workshop 4 IDE.

The uLCD-32PTU

Prerequisites

This codebase example assumes that the reader already knows how to create a project and how to program a display module in the ViSi-Genie environment. Beginners may refer to any of the following application notes.

The Project


The attached ViSi-Genie project was created by adding three slider objects to the WYSIWYG area. Slider0 and Slider1 were configured to report an event when they are touched (see the images below). The orientation and color of each of the sliders were modified by changing the values of the correct properties in the Object Inspector. Static text objects were then added as labels.

Event Handler Configuration

Slider0 : OnChanged

Slider0

Slider1 : OnChanging

Slider1

Slider2 : No Event Handler

Slider2

When Slider0 or Slider1 is touched, it changes state accordingly and sends a message to the serial port. See the accompanying video to know the difference between the OnChanged and OnChanging event handler configurations. The serial port of the display module is connected to a uUSB-PA5 programming module, which, in turn, is connected to a USB port of the PC.

The GTX Tool


The Workshop 4 IDE has a utility that can be used to communicate with the display module through the programming module (a uUSB-PA5 or a 4D USB Programming cable). The GTX tool runs on the PC and displays messages coming from the display module. Conversely, the GTX tool can also send messages to the display module.

the GTX Tool

The Genie Standard Protocol

Again, 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 Genie Standard Protocol provides a simple yet effective interface between the display and the host controller and all communications are reported over this bidirectional link. The protocol utilizes only a handful of commands and is simple and easy to implement. In this codebase example, the use of the following messages of the Genie Standard Protocol is demonstrated.

Message Description
READ_OBJ This message is used for reading the value(state) of an object. A READ_OBJ message is sent by the host to the display module.
WRITE_OBJ This message is used for changing the value(state) of an object. A WRITE_OBJ message is sent by the host to the display module.
REPORT_OBJ This is the response message from the display after the host issues a READ_OBJ message.
REPORT_EVENT When correctly configured, an object on the display can send a REPORT_EVENT message when its value(state) has been changed through touch.

To know more about the Genie Standard Protocol, see the ViSi-Genie User Reference Manual.

Project File(s)


Location and Filename Description
Workshop Files\
Slider_R_1_0.zip
This is the Workshop ViSi-Genie project zip file.

Instructions


Follow the procedure below to run this example. The reader is also advised to watch the accompanying video.

  1. Extract the content/s of the ViSi-Genie 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 Workshop 4 IDE.

The application should now run. If not familiar with the details of the steps above, see the application notes below.


Property Details
Number 4D-CD-00068
Revision 1.00
Author 4D Systems
Difficulty easy
Tested on a uLCD-32PTU
Relevant 4D Product/s All Picaso and Diablo16 touch displays
Workshop 4 Environment ViSi-Genie
Recommended Codebase Examples NA
Relevant Application Notes ViSi-Genie Getting Started - First Project for Picaso Display Modules.

ViSi-Genie Getting Started - First Project for Diablo16 Display Modules.
Relevant Projects NA
Relevant Workshop 4 IDE Examples NA