Well, I don't know exactly if you already know how the touchpanel works on the DCULx. The idea is that you can use the existing elements now with the touchpanel without any further work. For example you can simply use the touchpanel to select entries of a menu. Nothing has to be done, simply touch the menu entries.
But as we don't have a special button element, it still requires a few things to built such buttons that are sensitive to touchpanel input. But by using the new FIELDTAB element you can define rectangular regions on the display, that are recognized when you touch them or release them on the touchpanel. Usually you will draw some kind of button with rectangles, texts and/or graphics in each of these regions so that the user will see these regions as buttons.
Example:
So you have to give the upper left corner of the rectangular region and the width and height. By giving the attribute you can tell if the region will be recognized if the touchpanel is pressed or if it is released within this region. If a region is recognized as activated, then it works as if you had pressed a key on a matrix keyboard, so it generates a scan code. (1 to 4 in the example). By using the common features for matrix keys, this input data can be used to switch to other windows, enter data in an edit field, and so on. So by using this FIELDTAB element, you can do everything you can do with a matrix keyboard. The example above divides a 320x240 display into four quadrants. E.g. if you press on the upper right quarter, then key code 2 is generated (on press down), if you press on the lower right quarter of the display, the key code 4 is generated (when the panel is released again).
The first FIELDTAB in the source code is automatically the global FIELDTAB. But you can also "call" a FIELDTAB as an element in a GROUP or WINDOW. Then starting from there the new FIELDTAB is active.
There are a few other commands that are important when using the touchpanel. For example at the beginning the touchpanel must be calibrated once. This draws four marks on the display that have to be touched one after the other. This is required to get a correct mapping between analog input data from the panel and the screen coordinates. Calibrating is started by the commands:
Compilermode: QX<LF>
Terminalmode: <ESC>QX
The difference is that in Terminalmode the values determined during calibration are returned via the serial line. So you can store these values and set them again on the next start without having to do calibration again. The Compilermode variant does not return the values. In the future the DCUL7 will store the calibration data itself in flash memory in this case, but this feature is not yet implemented. So for the moment I recommend the Terminalmode version and storing the data in your application.
Another command may be interesting for you to react on arbitrary touchpanel action. If you switch on the touchpanel reporting by <ESC>QT<n>, every movement on the touchpanel bigger than <n> is reported via serial line. But be aware that this may generate quite a lot of data and the serial line may be a bottleneck then. Only use this if the built-in features (FIELDTAB) don't fit your needs at all.
So here is a summary of commands for touchpanel control.
Touchpanel commands for Compilermode
------------------------------------
"QX<LF>"
Start touchpanel calibration and store values in flash memory.
Touchpanel commands for Terminalmode
------------------------------------
"<ESC>QX"
Start touchpanel calibration. When this is done, the determined parame-
ters are automatically activated and reported as
QN<aV>,<bV>,<aW>,<bW>,<aR>,<bR>,
aV, bV: analog values V' of display vector V = (xmax, 0) - R
aW, bW: analog values W' of display vector W = (0, ymax) - R
aR, bR: analog values R' of reference point R(0, 0)
"<ESC>QP<aV>,<bV>,<aW>,<bW>,<aR>,<bR>,"
Set the analog parameters of vectors V', W' and reference point R'.
"<ESC>QT<thres>,"
Set the threshold value. Only changes bigger than this will be reported
to the user. By setting this threshold to zero, the reporting of values
is completely switched off (default: 0). However when fields or menus are
active in Compilermode, the touchpanel inputs converted to keys may still
be reported, depending on the keyboard settings.
"<ESC>QM<flag>"
Set raw reporting mode:
0 : Touchpanel values are reported converted to display coordinates
-1: Touchpanel values are reported raw (0..1023)
Regards
F&S Support Team