INOS
TFT display

Enable TFT display

The TFT display doesn't need to be enabled, the necessary files are always part of an inos project.

The functions to access the display directly are documented in cinossiotft.h. The explorer functionality is in cinossiotftexp.h

TFT display config

The TFT display is connected via RS232 (SIO). Therefore a .dt2 config file is needed to configure the COM-port for the TFT display.

hw-mas-sio.dt2

// ! table-name
HW-MAS-SIO-CHN
// ! table-data-record-start
Name; text_32; "COM1"; // channel name
Baudrate; uint32; 115200; // baudrate
ParityEnabled; uint8; 0; // parity (0=disabled, 1=enabled)
ParityOdd; uint8; 0; // odd/even (0=even, 1=odd)
DataBits; uint8; 8; // data bits (7 or 8)
StopBits; uint8; 1; // stop bits (1 or 2)
Options; uint8; 1; // 0x01=ignore DSR error
ChannelNo; uint8; 0x01; // channel number
//! table-data-record-end

This port then needs to be given to the TFT display driver so it knows how to communicate with the display hardware. The TFT name can be chosen freely but needs to be valid for registering in the INCO tree. If the internal explorer application should be used then another .xml config file is needed for the content of the explorer. The name of this file also needs to be passed to the display driver.

tftdisplay.xml

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--
trans-table-type="xcfg-mod-sio-tft"
-->
<Card Name="TFT" ProductName="SIO-TFT" ProductCode="611145101" VendorId="0">
<Card Name="TFT1" Interface="COM1" ExplorerDef="tftexplorer_xml"/>
</Card>

The simplest form of the explorer is in text form and looks like a table with the variable names on the left, the values in the middle and the units on the right, similar to the desktop INCOExplorer application. The registered call procedures are shown at the bottom of the display.

tftexplorer.xml

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<Inco>
<Folder Name="MyApp" ValueColumn="23" UnitColumn="45">
<Var Type="title" Name="App values" ></Var>
<Var Type="title" Name="----------"></Var>
<Var Type="nop"></Var>
<Var Path="MyApp.Prop.Value1"></Var>
<Var Path="MyApp.Prop.Value2"></Var>
<Var Path="MyApp.Prop.Value3" Char="0x01"></Var>
<Var Type="nop"></Var>
<Var Path="MyApp.Data.Setting1" Char="0x01"></Var>
<Proc Path="MyApp.SetLangDE"></Proc>
<Proc Path="MyApp.SetLangEN"></Proc>
<Proc Path="MyApp.StartMeasure"></Proc>
</Folder>
<Folder Name="MyApp" ValueColumn="23" UnitColumn="45">
<Var Type="title" Name="System values" ></Var>
<Var Type="title" Name="-------------"></Var>
<Var Type="nop"></Var>
<Var Path="Target.Prop.Temperature"></Var>
<Var Path="Target.Memory.Pools.Heap.FreeSize"></Var>
<Var Path="Target.Prop.IpAddress"></Var>
<Proc Path="Target.Cmd.Reset"></Proc>
</Folder>
</Inco>

TFT explorer config file

A standard xml file header.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

Needed in every file to form a valid xml file.

Inco explorer node

<Inco>
<Explorer ...
<button ...
<Lang ...
<Folder ...
</Inco>

The file needs a standard xml file header as all xml files do. All explorer items are contained in a node named Inco. This includes all folders, variables, procedures, images, languages etc. The Inco node itself

Inco explorer settings

<Explorer TFTProject="My TFT Project" MacroFile="MyTFT_DF" UserLayout="1" Debug="0"/>

The explorer application can have some global settings. At startup the system can check that the TFT application burned into the display is correct. If it's not then it's possible to load the MacroFile into the display.

AttributeDescriptionRequired
TFTProject Name of the project to check for in the TFT display.
MacroFile Name of the file to load into the TFT display if necessary.
UserLayout Set to one if the layout should not be the standard explorer layout.
Debug Switch on debugging: Eventlog traces, borders around visual elements.

Folder node

// UserLayout=0
<Folder Name="AppFolder" ValueColumn="23" UnitColumn="45">
</Folder>
// UserLayout=1
<Folder Name="Production" BitmapActive="35" BitmapInactive="34" PosX="680" PosY="157" SizeX="120" SizeY="79" ColBack="8">
</Folder>

Depending on the UserLayout setting the attributes can be very different.

AttributeDescriptionUserLayout
Name Name of the folder. Always required
ValueColumn Text column of variable values. 0
UnitColumn Text column of variable unit. 0
BitmapActive Number of bitmap for active state. 1
BitmapInactive Number of bitmap for inactive state. 1
PosX X coordinate of folder image. 1
PosY Y coordinate of folder image. 1
SizeX Width of folder image. 1
SizeY Height of folder image. 1
ColBack Background color for folder image. Use 255 for parent color. 1
LangX Translation for language X. 0/1

Variable node

// UserLayout=0
<Var Type="title" Name="MyTitle" Lang2="Translation2"/>
<Var Type="nop"/>
<Var Path="MyApp.MyVar" Char="0x01"/>
// UserLayout=1
<Var Type="bitmap" Name="status_off" Bitmap="10" PosX="7" PosY="7"/>
<Var Type="static" Name="description" Value="A Description" PosX="356" PosY="375" SizeX="40" SizeY="30" Align="1"/>
<Var Path="MyApp.MyVar" ReadOnly="1" PosX="0" PosY="125" SizeX="200" SizeY="60" Digits="0" Align="3" Char="1" Frame="0"/>

Depending on the UserLayout setting the attributes can very different.

AttributeDescriptionUserLayout
Name Name of the variable. Optional
Type If no Path is given then the type must define the type of the variable: title, static, bitmap, nop. 0/1
Path Inco path of registered variable. 0/1
ReadOnly Don't allow writing to variable. 0/1
Min Minimum value for writing variable. 0/1
Max Maximum value for writing variable. 0/1
Digits Number of digits of shown variable value. 0/1
Char Characteristics of shown variable value. 0/1
Value Type static: Fixed value to show. 0/1
KeyBoard Keyboard layout to use for editing variable. 0/1
Bitmap Number of bitmap for variable. 0/1
BitmapActive Number of bitmap for active state. 1
BitmapInactive Number of bitmap for inactive state. 1
PosX X coordinate of variable image. 1
PosY Y coordinate of variable image. 1
SizeX Width of variable image. 1
SizeY Height of variable image. 1
ColFore Foreground color for variable. Use 255 for parent color. 0
ColBack Background color for variable. Use 255 for parent color. 0/1
LangX Translation for language X. 0/1

Procedure node

// UserLayout=0
<Proc Path="MyApp.MyProc"/>
// UserLayout=1
<Proc Path="Machine.Cmd.Confirm" Name="confirm" Bitmap="64" PosX="80" PosY="0" SizeX="580" SizeY="75"/>

Depending on the UserLayout setting the attributes can very different.

AttributeDescriptionUserLayout
Name Name of the procedure. Optional
Path Path of registered Inco procedure. Required
Bitmap Number of bitmap for variable. 0/1
PosX X coordinate of variable image. 1
PosY Y coordinate of variable image. 1
SizeX Width of variable image. 1
SizeY Height of variable image. 1
ColFore Foreground color for variable. Use 255 for parent color. 0
ColBack Background color for variable. Use 255 for parent color. 0/1
Align Align variable value.
Frame Draw a frame around variable. 1
Font Font to use for this variable 1
LangX Translation for language X. 0/1

Language node

<Lang Name="German" File="german_txt"></Lang>
<Lang Name="English" File="english_txt"></Lang>

The language translations of the various visual elements can be given directly in the xml node of the element in the explorer xml definition file. However it might be cleaner and easier to handle if the translations are all kept in a separate file (one per language). In this case the used trnalsation files need to be given to the explorer application with Lang xml nodes.

If both LangX=".." and language files are present then the entry in the node gets priority over the file. Like this it is possible to have a general translation in the file and still use a different text for some special items.

The format of the language files need to be like this: Name <TAB> Translation <EOL>

This is chosen to keep the handling as well as the parsing as simple as possible.

AttributeDescriptionRequired
Name Name of the language. X
File Name of text file as stored in the DatabaseTables. X

Example german.txt

MyApp Prima Applikation
Value1 Wert 1
Value2 Wert 2
Value3 Wert 3
Setting1 Einstellung 1

Example english.txt

MyApp Super Application
Value1 Value 1
Value2 Value 2
Value3 Value 3
Setting1 Setting 1

Button node

<button ColNormFill="6" ColNormOut="2" ColNormIn="13" ColSelFill="7" ColSelOut="1" ColSelIn="16" Frame="11" FontNr="5" FontZoomX="1" FontZoomY="1" ColNormFont="1" SizeX="32" SizeY="32"/>

Only for UserLayout="1" it is possible to define the look of buttons.

AttributeDescription
ColNormFill Color in normal state for filling.
ColNormOut Color in normal state for outline.
ColNormIn Color in normal state for inline.
ColSelFill Color in selected state for filling.
ColSelOut Color in selected state for outline.
ColSelIn Color in selected state for inline.
Frame Number of frame to use.
FontNr Number of font to set.
FontZoomX Zoom factor in horizontal direction.
FontZoomY Zoom factor in vertical direction.
ColNormFont Text color in normal state.
SizeX Horizontal size of button.
SizeY Vertical size of button.

Issues

The display is connected to a COM-port, the commands are sent in a text protocol. If there are errors in the transmission then the sent commands are not valid anymore. However the display will still try to interpret them as valid and may do something that was not intended e.g. change from text mode to graphics mode. First try to remedy the situation is by sending a reset command to the display which it hopefully still understands: CINOSSioTft::ResetDisplay.

It's also possible that the display controller will get completely asynchronous and not accept any command anymore. In this case it helps to switch off and on the TFT display.

If even switching the display off and on doesn't help then it's possible that the macro file that was burned into the display got corrupt and prevents the display from starting up correctly. In this case there's a jumper/bridge on the back that can be set before power on.

DPOM = Disable Power On Macro

If this makes the display boot up again normally then the macro file can be burned again over the SIO cable. If this still doesn't help then the hardware might be at fault.