Visi User Button: Document Date: Document Revision
Visi User Button: Document Date: Document Revision
W W W . 4 D S Y S T E M S . C O M . A U
APPLICATION NOTES 4D-AN-00030
Description Content
This application note provides a first hands-on example with ViSi-Genie and Description...................................................................................................... 2
describes all the steps related to a project. Content ........................................................................................................... 2
Application Overview ..................................................................................... 3
Before getting started, the following are required:
Setup Procedure ............................................................................................. 4
• Workshop4 has been installed according to the document Create a New Project...................................................................................... 4
Workshop4 Installation; Create a New Project .................................................................. 4
• The user is familiar with the Workshop 4 environment and with the Design the Project .......................................................................................... 5
fundamentals of ViSi-Genie, as described in Workshop 4 User Guide Adding a Momentary User Button ............................................... 5
and ViSi-Genie User Guide;
Defining the States of a Momentary User Button 6
• When downloading an application note, a list of recommended
Naming of Objects....................................................................... 9
application notes is shown. It is assumed that the user has read or
Adding a Static Text .................................................................... 9
has a working knowledge of the topics discussed in these
recommended application notes. Adding a New Form .................................................................. 11
Linking Forms ........................................................................... 12
Adding a Toggle User Button .................................................... 12
Defining the States of a Toggle User Button 12
Configuring a User Button as a Toggle Button 13
Adding a User LED ................................................................... 14
Linking Objects 14
Configuring the User LED to Report a Message 15
Create a Button Matrix .............................................................. 16
Adding Three User Buttons 16
Page 2 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
State 0
State 1
User Button
(Toggle)
State 2
State 3
Page 3 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
Option 1
Setup Procedure
User Button For instructions on how to launch Workshop 4, how to open a ViSi-Genie
Option 2
Matrix project, and how to change the target display, kindly refer to the section
“Setup Procedure” of the application note:
Option 3
ViSi Genie Getting Started – First Project for Picaso Displays (for Picaso)
A key feature of the user button is that the user can specify the image files or
to be used for each of the states. The simple project developed in this ViSi Genie Getting Started – First Project for Diablo16 Displays (for
application note demonstrates the basic use of a user button. A user button Diablo16).
can be configured to behave as a momentary button, a toggle button, or one
among a group of buttons. Each of these configurations has its own
application. Create a New Project
Create a New Project
The section “Identify the Messages” also discusses the format of the
messages coming from and going to a user button using the GTX Tool in For instructions on how to create a new ViSi-Genie project, please refer to
Workshop. An understanding of this section is essential for users who intend the section “Create a New Project” of the application note
to interface the display to an external host.
ViSi Genie Getting Started – First Project for Picaso Displays (for Picaso)
or
ViSi Genie Getting Started – First Project for Diablo16 Displays (for
Diablo16).
Page 4 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
Page 5 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
The object can be dragged to any desired location and resized to the desired Defining the States of a Momentary User Button
dimensions. The Object Inspector on the right part of the screen displays all A momentary button is enabled when pressed and disabled immediately
the properties of the newly created user button object named Userbutton0. upon release. It can be conveniently used for navigating between forms,
starting and stopping a timer, and navigating between the frames of a video
or a user images object. Here the momentary user button is used to navigate
to the next form. To define the up and up pressed states, click on the ellipsis
dots of the Images property line of the object inspector.
The Image List editor window appears. Click on the Add button to browser
By default, a user button is a momentary button. Note that the property for the image files.
“Momentary” is set to “Yes”.
Page 6 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
A standard open window appears and asks for image files. Multiple files can
be selected. The figure below shows the two image files used for
Userbutton0. All the image files used in this demo are saved in the
“.ImgData” folder, which is automatically generated by Workshop when the
project is compiled. After having selected the desired image files, click on
the Open button.
The left-most column lists the image numbers or the states. For additional
information, hover over the Add button:
Note that Userbutton0 is a momentary button. Hence, it only has two states
– ‘up’ and ‘up pressed’.
The Image List editor window is again displayed.
Page 7 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
To illustrate: To rearrange the order, select an image and click on the Up or Down button.
Momentary User Button
State 0
Initial state
or up
Button is State 1 or
pressed up pressed
After having arranged the images to the desired order, click on the OK
button. The WYSIWYG screen is updated with the initial state displayed.
Page 8 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
Naming of Objects
Naming is important to differentiate between objects of the same kind. For
instance, suppose the user adds another user button object to the WYSIWYG
screen. This object will be given the name Userbutton1– it being the second
user button object in the program. The third user button will be given the
name Userbutton2, and so on. An object’s name therefore identifies its kind
and its unique index number. It has an ID (or type) and an index.
Userbutton0
Object ID
Object index
Page 9 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
Click on the WYSIWYG screen to place the object. Drag it to any desired Change the caption in the object inspector.
location.
Page 10 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
C
A new blank form, named Form1, is generated.
Experimentation with the other properties of the static text is left to the user
as an exercise. To navigate back to Form0 in Workshop, click on the drop-down menu arrow
of the object inspector as shown below and select Form0.
Page 11 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
Linking Forms
Now that there are two forms, a button in Form0 can be used to display The object inspector is updated accordingly.
Form1 (and vice-versa) when the application runs. Here Userbutton0 of
Form0 is configured as a navigation button. In Form0, select Userbutton0,
go to the object inspector, and select the Events tab. Click on the ellipsis
dots of the OnChanged event.
Page 12 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
State 0
Initial state
or up
State 1 or
Button is pressed
up pressed
State 2
Button is released
or down
State 3
Button is pressed
or down pressed
Page 13 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
Adding a User LED The object can be dragged and resized. The properties can be edited in the
To add a user LED, go to the Digits pane and select the user LED icon. Object Inspector. Userled0 in Form1 has the following properties:
Linking Objects
Now that Userbutton1 is a toggle button, it can be used to control Userled0.
Go to Userbutton1’s object inspector and click on the ellipsis dots of the
onChanged event.
Page 14 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
The On event selection window appears. Select Userled0Set and click OK. Add another static text object to the form. When done, the form should look
like as shown below.
Page 15 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
This form will contain three user buttons which form a matrix. Buttons in a
matrix behave such that only one button can be enabled at a time. Enabling
another button disables all the other buttons. A matrix of buttons can be
conveniently used as a GUI menu.
C
These buttons are identical to Userbutton1 in Form1. Each of these buttons
is configured as a toggle button.
Page 16 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
It is important that all buttons grouped share the same number of matrix,
otherwise pressing on one button will not release the other buttons of the
group.
Page 17 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
The Project
The project now has three forms. In Form0 is Userbutton0 which is a
momentary button used for displaying the next form – Form1.
Page 18 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
ViSi Genie Getting Started – First Project for Picaso Displays (for Picaso)
or
ViSi Genie Getting Started – First Project for Diablo16 Displays (for
Diablo16).
Page 19 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
A new window appears, with the forms, user buttons, and the user LED
C
created previously.
When Form1 is displayed, toggle the user LED by playing with Userbutton1.
Page 20 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
By following the cycle illustrated below, the user will observe that a message Observe the white area on the right part of the GTX tool window. It displays
is sent to the host upon the release of a press. the message received from the display module.
State 0
Initial state
or up The actual message bytes are those inside the brackets. These values are in
hexadecimal. The figure preceding the actual message is the computer time
at which the message is sent. A label is also included to tell the observer
what the message represents.
time message
State 1 or
Button is pressed
up pressed
User
REPORT_EVENT Second 0x0001
button
State 3
Button is pressed The message is from Userbutton0, and it contains the hexadecimal value
or down pressed
“0x00001”. When a toggle button is enabled, the value is 0x00001 or simply
1 in decimal. When a toggle button is disabled, the value is 0x0000 or simply
0 in decimal. Verify this by toggling the button back to its very first state.
Page 21 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
result is appended to the end to yield the checksum byte. If the message is
correct, XOR’ing all the bytes (including the checksum byte) will give a result
State 2 of zero. Checking the integrity of a message using the checksum byte shall
Initial state
or down be handled by the host.
The object ID of a user LED is 0x13. See section 3.3 of the ViSi Genie
State 0 A message is sent to the host Reference Manual for a full list of object IDs. The above is not the case
First state at this point.
or up however since a user LED is classified as an output object. Only input objects
such as a user button can initiate an event. The message therefore is actually
from Userbutton1, although it is Userled0 that was configured to report a
message. To learn more about the input-output classification of Genie
The message sent when the user button has just been disabled is shown objects, refer to section 7 of the ViSi-Genie User Guide.
below.
The checksum is a means for the host to verify if the message received is
correct. This byte is calculated by XOR’ing all bytes in the message from (and
including) the CMD or command byte to the last parameter byte. Then, the
Page 22 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
Toggle a User Button using the GTX Tool The message stands for “Write to the second user button object on the
In the GTX tool window, click on the button indicated below. display module the value 0x0001”.
• in green the messages sent to the display module Poll the User Button
• and in red the messages received from the display module If the user button (or any other output object linked to it) was not configured
to report a message when its status has changed, it is still possible (although
sometimes not advisable) to know its current status (enabled or disabled).
C
To do be able to do this, click on the Query button.
The message sent is formatted according to the following pattern:
01 21 01 00 01 20
Messages are sent to and received from the display module.
User
WRITE_OBJ Second 0x0001
button
Page 23 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
00 21 01 - - 20
User
READ_OBJ Second N/A
button
05 21 01 00 01 24
User
REPORT_OBJ Second 0x0001
button
The host sends a READ_OBJ command specifically asking for the value (or
status) of the second user button object. The display module then responds
with the current value of that user button. Communication between a 4D
display module programmed with a ViSi-Genie application and an external
host controller must follow the ViSi-Genie Communications Protocol, which
is defined in the ViSi Genie Reference Manual.
Page 24 of 25 www.4dsystems.com.au
APPLICATION NOTES 4D-AN-00030
Proprietary Information
The information contained in this document is the property of 4D Systems Pty. Ltd. and may be the subject of patents pending or granted, and must not be
copied or disclosed without prior written permission.
4D Systems endeavours to ensure that the information in this document is correct and fairly stated but does not accept liability for any error or omission. The
development of 4D Systems products and services is continuous and published information may not be up to date. It is important to check the current position
with 4D Systems.
All trademarks belong to their respective owners and are recognised and acknowledged.
Page 25 of 25 www.4dsystems.com.au