Skip to content

ViSi-Genie: Using Combined Objects

Description

This Application Note details how to use the COMBINED OJECTS or INPUT/OUTPUT OBJECTS.

Most INPUT OBJECTS can also function as OUTPUT OBJECTS, with the notable exception of Keyboards. Certain objects need both an input stimuli as well as produce an output event. For example, a slider thumb position may need to be remotely controlled from incoming serial data. A button may need to be animated not only using the touch screen but via serial data.

This application note requires:

  • Workshop4 has been installed as discussed here;
  • The user is familiar with the Workshop4 environment and with the fundamentals of ViSi-Genie, as described in Workshop4 User Guide and ViSi-Genie User Guide;
  • When downloading an application note, a list of recommended application notes is shown. It is assumed that the user has read or has a working knowledge of the topics discussed in these recommended application notes

Note

A ViSi-Genie project is provided as example to help you along this application note.

Downloadable Resources

The following are the sample project files for DIABLO-16 and PICASO:

PICASO DIABLO-16

Application Overview

COMBINED OBJECTS bring flexibility to a user interface, acting as both INPUT and OUTPUT.

Imagine an air conditioning control panel, with three level of authorisation:

  • Ground level, everyone can adjust the temperature;
  • Management level, some managers can impose a given temperature;
  • Technical level, only technicians can override the previous settings.

In this application, three track-bars have different priorities:

  • The red track-bar is the master control and updates all the others: it is an INPUT OBJECT,
  • The green track-bar is the intermediate control and only updates the blue track-bar: it is COMBINED OBJECT.

  • So is the blue track-bar, as the slave control.

  • Finally, the LED digits object only displays the value: it is an OUTPUT OBJECT.

App Overview

Technical level has access to the red track-bar, management level to the green track-bar and everyone to the blue track-bar.

Setup Procedure

This application note comes with ViSi-Genie projects you can find in Downloadable Resources.

For instructions on how to launch Workshop4, how to open a ViSi-Genie project, and how to change the target display, kindly refer to the section “Setup Procedure” of the application note:

Create a New Project

For instructions on how to create a new ViSi-Genie project, please refer to the section “Create a New Project” of the application note

Simulation Procedure

You can load the example project files under the Downloadable Resources section or follow the procedures described hereafter.

Select the Home menu to display the objects:

Simulation Procedure

Build the Interface

The TrackBar object is located on the Inputs pane:

Build the Interface

Click first on the TrackBar icon

Trackbar Icon

and then click on the desired location on the form to place it:

Desired Location

This first track-bar is named TrackBar0

To change the colour of the track-bar, go to the Object Inspector

Object Inspector

click on the icon on the Colour line

Colour line

a new window Colour Picker is displayed.

Colour Picker

Pick the colour and press OK to confirm. The track-bar is red now:

TI

Proceed the same way for the green and blue track-bars, named respectively TrackBar1 and TrackBar2. Result is:

TI

The LedDigits object is located on the Inputs pane:

LedDigits

Click first on the LedDigits icon

LedDigits Icon

and place it on the screen.

Final result is:

LedDigits

Define the Commands

The red track-bar TrackBar0 is the master control. When the cursor of TrackBar0 is moved, the onChanging event is raised and the Set command is sent to the green track-bar TrackBar1 along with the value:

Colour Picker

The red track-bar is an INPUT OBJECT.

The green track-bar TrackBar1 is the intermediate control.

When the cursor of TrackBar1 is moved and released, the onChanged event is raised and the Set command is sent to the blue track-bar TrackBar2 along with the value:

Colour picker

The green track-bar is updated on two different ways:

  • When the user move and release the cursor, the track-bar records the new value: it acts as an INPUT OBJECT;
  • When it received a command from the red track-bar: it acts as an OUTPUT OBJECT.

The green track-bar is a COMBINED OBJECT.

The blue track-bar is the slave control.

It has no event.

Colour picker

The blue track-bar is updated on two different ways:

  • When the user move and release the cursor, the track-bar records the new value: it acts as an INPUT OBJECT;
  • When it received a command from the red track-bar: it acts as an OUTPUT OBJECT.

The blue track-bar is also a COMBINED OBJECT.

The last object, LEDDigit0, only displays the value it receives from the blue track-bar. It has no event.

Colour picker

The LED digit is an OUTPUT OBJECT.

Build and Upload the Project

For instructions on how to build and upload a ViSi-Genie project to the target display, please refer to the section “Build and Upload the Project” of the application note

The uLCD-32PTU and/or the uLCD-35DT display modules are commonly used as examples, but the procedure is the same for other displays.

Debugger Output

Setting the handler to Message sends the values to the debugger, Genie Test Executor or GTX.

Launch the Debugger

To launch the Genie Test Executor or GTX, select the Tools menu

Genie Test Executor

and then click on the GTX button.

GTX

A new screen appears, with the form and objects we have defined previously:

FB

The Query buttons read the value from each track-bard and display them on the debugger:

Query

Use the Project

Initial values are all set to zero:

UP

Press the Query buttons. The debugger shows:

Query

The right part of the debugger shows the messages sent and received for each track-bar:

Request Trackbar Value 15:16:49.160 [00 05 00 05]

Trackbar Value 15:16:49.192 [05 05 00 00 32 32]

Request Trackbar Value 15:16:49.706 [00 05 01 04]

Trackbar Value 15:16:49.753 [05 05 01 00 4D 4C]

Request Trackbar Value 15:16:50.596 [00 05 02 07]

Trackbar Value 15:16:50.627 [05 05 02 00 00 02]

The hexadecimal value of 00 00 stands for 00 in decimal.