Functions

All functions are defined in the DLL 'RIOCOM.DLL'. The DLL has to be incorporated in the programming language to be used. the download examples are all in VB. You can use the emulator to run the examples without having to depend on external hardware.

General functions

InitializeComm
int __stdcall InitializeComm (ComPort int, int baudrate);

Opens the serial port for communications and initialize those communications.

Behaviour must be 1,2,3 ...
Baudrate must be 9600,19200,38400

If the ComPort is 0 then it will automatically search for a port with the base connected.
In this situation the function returns 0 if it doesn't find the base or the number of the open ComPort.


ForceResetOnAllTerminal
void __stdcall ForceResetOnTerminal();

Esta função deve ser usada depois do T_InitializeComm, e faz com que os terminais se o PC for desligado no meio de uma sessão façam um restet automático, evitando assim ter que se fazer um reset.

This function should be used after T_InitializeComm, and makes the terminal, if the PC is turned off in the middle of a session, to do a restet automatic, thus avoiding having to do a reset.


TerminateComm
void __stdcall TerminateComm(int ComPort);

Closes the port


ForceResetOnTerminal
void __stdcall ForceResetOnTerminal(char *TerminalId);


The next time the terminal tries to communicate, it will receive an instruction to do a reset.


T_ResetComunications
int __stdcall T_ResetComunications();

This command allows a terminal restore communications with the PC after you exit and enter the application on the PC.

In normal situation when there is a break in the communications we need to do a reset (pressing the button with a clip) to reset the terminal.

To use this command it is necessary that the program on the PC when exiting do a T_SaveScreens and then when re-initiating, do a T_LoadScreens.
If you don't do a T_SaveScreens and a T_LoadScreens the program will certainly get stuck.

T_SaveScreens
int __stdcall T_SaveScreens(char *filename);

While the DLL communicates with the terminals it will keep in memory a copy of the memory of the terminal to optimize communication.

The terminals communicating with the PC send only changes to the screens.

This function saves the state of the memory of the terminal to the disk.


T_LoadScreens
int __stdcall T_LoadScreens(char *filename);

While the DLL communicates with the terminals, it will keep in memory a copy of the memory of the terminals to optimize communication.

When the terminals communicate with the PC, they send only changes to the screens.

This function reads from the disk the state of memory of the terminals.


T_SaveComunicationStatus
int __stdcall T_SaveComunicationStatus( char *filename);


While the DLL communicates with the terminals will keep in memory a copy of the memory of the terminal to optimize communication.

This function writes to the disk the state of the memory of terminal related to communications.

Using this function avoids having to make T_ResetComunications if the PC is off.



T_LoadComunicationStatus
int __stdcall T_LoadComunicationStatus( char *filename);


While the DLL communicates with the terminals it will keep in memory a copy of the memory of the terminal to optimize communication.

This function reads from the disk the state of memory of the terminals related to the communications.

Using this function avoids having to make T_ResetComunications if the PC is off.



T_InitScreen
int __stdcall T_InitScreen(char *TerminalId,char *ScreenName,int ScreenFlags,int ScreenCursor,int ScreenValidate);
char *TerminalId


Pointer to the terminal's name. The name must be composed by : XXXXXXDD, where XXXXXX on an installation must be equal and the DD must be different. Exp. "TESTE 01","TESTE 02"

char *ScreenName
Pointer to the screen's name.
The screen's name can be of any size.

char *ScreenFlags

int ScreenCursor

Initial position of the cursor on the screen. Counts the number of Gets...() achieved.



Int ScreenValidate

Second when the screen looses validity.
The current second can be calculated by:((Date - 35065) + Time) * 24 * 60 * 60 in VB.



T_SendScreen
int __stdcall T_SendScreen();


Sends the current screen to the terminal. Should be performed after doing a T_InitScreen.
Sends the screen from the PC to the terminal.



T_WaitAnyScreenFromPc
int __stdcall T_WaitAnyScreenFromPc();


The terminal stays for ever waiting that the PC sends some screen.



T_RefreshScreen
int __stdcall T_RefreshScreen(char *TerminalId,char *ScreenName);


Everytime a terminal's screen is received, the variables on the PC should be updated. To achieve that, a T_RefreshScreen should be done followed by the same code that was used to create a screen.



T_SetLcdLightPower
int __stdcall T_SetLcdLightPower(char state);

Turns on and off the screen's light.

 


T_SetSeconds
int __stdcall T_SetSeconds(int seconds);


In VB to set the clock from the terminal you can use:
T_SetSeconds ((Date - 35065) + Time) * 24 * 60 * 60



RIOCOM_AutoAdjustSeconds
int __stdcall RIOCOM_AutoAdjustSeconds();

Sets the hour on the terminal with all communications with the PC. The internal hours from the PC are sent to the terminal.


T_ReadSeconds
int __stdcall T_ReadSeconds();


Returns the number of second on the terminal.


T_SetLaserParameter
int __stdcall T_SetLaserParameter(int parameter,int value);


Configures the Laser.

 

T_Beep
int __stdcall T_Beep(int duration,int periodo);


Makes a Beep on the Terminal.

 

T_Alarm
Makes a more elaborated beep. The following code exemplifies what happens.

FOR X=1 TO repeat_n
FOR N= freq_min TO freq_max
Beep(delay,N)
NEXT
NEXT



T_SendScreenToPc
int __stdcall T_SendScreenToPc(char *ScreenName,int scr_flags);


Sends a screen to the buffer which will be sent to the PC.

ScreenName , name of the screen to send.
scr_flags , changes all the flags from this screen.

This command uses the following flags:

#define scr_flag_update_pc_if_possible 4
The terminal sends this screen to the PC by radio, but it tries one time only.
If unable to send the data, it will keep it in an internal buffer and will send it whenever possible.

#define scr_flag_update_pc_now 8
The terminal sends this screen to the PC by radio, and if unable to send it will try without stop to send again. If unable to send, it will get stuck until it is in a location with good network.
#define scr_flag_update_pc_later 16
The terminal sends this screen to the PC by radio to the PC but not now.
It puts the data into the buffer to be sent, but it will not try to send it.


T_SendScreenToNull
int __stdcall T_SendScreenToNull(char *ScreenName,int scr_flags);


This command is identical to the previous one, it with the difference that it won't put anything into the buffer. It will send the screen to Null. It is important to use it if you want for example to cancel the sending of a screen. It should be used together with a flag scr_flag_restore_fields_after_send.

 

T_ChangeUpsideDown
int __stdcall T_ChangeUpsideDown(char flag);


Inverts the display. It doesn't work on the emulator.

 

T_PrintString
int __stdcall T_PrintString(char *txt);


Prints a string on the screen in the actual position of the cursor.

 

T_PrintLarge
int __stdcall T_PrintLarge(char *txt);


Prints a string on the screen in the actual position of the cursor.
Big font size.

 

T_PrintInverse
int __stdcall T_PrintInverse(char *txt);


Inversed print video.

T_NewLine
int __stdcall T_NewLine();


Changes line.

T_Cls
int __stdcall T_Cls();


Erases the screen.

T_WaitChar
unsigned char __stdcall T_WaitChar();


Returns the pressed key.

 

T_Delay
int __stdcall T_Delay(int miliseconds);


The terminal stays still. Useful for showing a results screen without demanding that a key should be pressed.

 

T_CheckIfReceiveData
int __stdcall T_CheckIfReceiveData(char *TerminalId,char *Screen_Name,char *DataType,int *RawDataSize,char *RawData);


Should periodically check if new data has been received.

#define data_type_send_screen_zipped 1
#define data_type_ask_screen 2
#define data_type_reset 3
#define data_type_send_screen_unzipped 4
#define data_type_softreset 5
#define data_type_send_CAddress 6
#define data_type_send_raw_data 7

For the programmer, the the zipped or unzipped screens are the same.
When the terminal asks for the terminal, it is because it doesn't have it in memory and it needs it.
Reset is when you actually do a reset to the terminal.

VB Example:

Private Sub Timer1_Timer()
Dim TerminalId As String
Dim ScreenName As String
Dim DataType As Byte
TerminalId = Space(8)
ScreenName = Space(50)
Do While T_CheckIfReceiveData(TerminalId, ScreenName, DataType)
ScreenName = Trim(ScreenName)
If Len(ScreenName) > 0 Then
ScreenName = Left(ScreenName, Len(ScreenName) - 1)
End If
Select Case DataType
Case data_type_reset
' Reset (TerminalId)
Case data_type_send_screen_zipped
ReceiveScreen TerminalId, ScreenName
Case data_type_send_screen_unzipped
ReceiveScreen TerminalId, ScreenName
Case data_type_ask_screen
AskScreen TerminalId, ScreenName
End Select
ScreenName = Space(50)
Loop
End Sub

Saving the program on the eeprom - in fact the file is being saved in the eeprom.bin.
It can be used with the devkit and it can receive a compiled program which may be sent to the serial port.

Several emulator can run, at the same time, as long as they have a TerminalID with different names.

 

T_SetLargeFunctionKeys
int _stdcall T_SetLargeFunctionKeys(char *txt,unsigned char NumberOfKeys);


This command defines the function keys which will be visualised with the flag GetText_flag_ForceFunctionKeys.

The difference of the previous function is that it permits to define more than just a character per key.

Example:
T_SetLargeFunctionKeys("MENU"+chr(27)+"SAIR"+chr(27),5)

The first parameter is the text showing on the screen.The last character is the key which will be sent to the terminal whenever the respective function key is pressed.For almost all applications, the character 27 (ESC) is the ideal because it makes that the T_Read terminates.

The second parameter is the number of characteres per key. In this example "MENU"(4) + chr(27)(1) =(5)

This was the first and second function keys would be defined. 8 keys can be defined. To gain access to the second group of 4, the shift key should be pressed ( Up arrow).

This function can be used in conjunction with the functions T_OnF1GotoScreen, T_OnF2GotoScreen..

T_ChangeScreenFormat
int __stdcall T_ChangeScreenFormat(int ScreenFormat);


This command defines the type of font used in all screens.

Line 1 --> (Big Font ) +1
Line 2 --> (Big Font ) +2
Line 3 --> (Big Font ) +4
Line 4 --> (Big Font ) +8
etc

For example, to have a whole screen with small font:
T_ChangeScreenFormat(0)

Line 1 and 4 with big font:
T_ChangeScreenFormat(1+8)

#define f_DefineMultipleBases 107

#define f_GetExit 108

T_DefineMultipleBases
int __stdcall T_DefineMultipleBases(int position,char *txt,char *base_name);


Makes the terminal, after booting, to ask which base to connect to. It can be useful for using the same terminal with different programs or even with different PC's.

The base_name is the base name. For instance 'BAS00'(default base name)

List functions

T_PutTextOnList
int __stdcall T_PutTextOnList(char *txt,int Value,char FastKey);


T_SetGetTextFromListFlags
int __stdcall T_SetGetTextFromListFlags(int flags)


Define the aspect of GetTextFromList in all future occurencies.
Example: T_SetGetTextFromListFlags GetText_flag_NotUnderline + GetText_flag_DontShowZero


T_GetTextFromList
int __stdcall T_GetTextFromList(int *number,int size,char *ScreenName);

T_CreateListIndex
int __stdcall T_CreateListIndex(char *ListName,int size);

Creates in the terminal's memory an index for a list. 'size' is the number of elements that the list can contain.
The Terminal spends internally (8*size) bytes of memory to maintain the list.


The sequence of commands for creating a list must be:

T_CreateListIndex "Users",10
T_ActivateListIndex "Users"

T_PutTextOnList ... puts into the list of users "Users" the various elements
T_PutTextOnList ... puts into the list of users "Users" the various elements
T_PutTextOnList ... puts into the list of users "Users" the various elements

T_PutTextOnList can be executed from various different screens.
After activating a list, all the T_PutTextOnList are related with the activated list.

T_GetTextFromList... Will get an element from the activated list.

T_DestroyListIndex
int __stdcall T_DestroyListIndex(char *ListName);

Frees the terminal's memory, destrying the list.

T_ActivateListIndex
int __stdcall T_ActivateListIndex(char *ListName);

Activates a list.

T_DesactivateListIndex
int __stdcall T_DesactivateListIndex();

De-activates a list.

T_CreateListIndex "LISTA COMIDAS", 1000
T_ActivateListIndex "LISTA COMIDAS"

ListName > Name to be given to a list. It could be any list, such as food or user lists.
Min,Max limit values of the List. These values cannot be too big because they spend a lot of terminal's memory.

Example,
T_CreateListIndex "Food List", 1000
Spends 8Kb of RAM memory in the terminal to create 1000 indexes.

To order to insert data into a list, it will need to activate the list first.
T_ActivateListIndex "LISTA COMIDAS"

Next, we should use the command PutTextOnList to insert data.


T_Cls
T_PrintInverse "MENU"
T_NewLine
T_Say "1-Order"
T_GetLink "ORDER DETAILS", 0, Asc("1")
T_NewLine
T_Say "2-Bill"
T_GetLink "CONTA", 0, Asc("2")
T_NewLine
T_Say "3-Cancel"
T_GetLink "CANCEL", 0, Asc("3")
T_NewLine
T_Say "4-Time"
T_GetLink "TIME", 0, Asc("4")
T_NewLine
T_Beep 50, 50
T_Read

int __stdcall T_GetLink(char *ScreenName,int Value,char FastKey);

int Value (Optional if 0 is not used)
To be used in conjuntion with GetTextFromList, when making Enter in GetTextFromList if the Value is the same the Terminal puts the cursor in that filed.

FastKey
Quick menu access key.


T_Cls
T_PrintInverse "MENU"
T_NewLine
T_NewLine
T_Say "1-Meat"
T_GetLink "MEAT", 10, Asc("1")
T_NewLine
T_Say "2-Fish"
T_GetLink "FISH", 20, Asc("2")
T_NewLine
T_Say "3-Wine"
T_GetLink "WINE", 30, Asc("3")
T_NewLine
T_Say "4-Drinks"
T_GetLink "DRINKS", 40, Asc("4")
T_NewLine
T_Say "5-Desserts"
T_GetLink "DESSERTS", 50, Asc("5")
T_NewLine
T_Beep 50, 50
T_Read



T_Cls
T_PrintInverse "ORDER"
T_NewLine
T_Say "Table:"
T_GetText table, 3, GetText_flag_Number
T_NewLine
st = "NO" + Chr(0) + "YES" + Chr(0)
T_Say "Receipt:"
T_GetOption receipt, st, Len(st), 2
T_NewLine
T_Say "OK"
T_GetLink "Order", 0, 0
T_Beep 50, 50
T_Read

int __stdcall T_GetOption(int *position,char *List,int LenList,int NumberOfElements);

int *position Pointer to the cursor's position. After executed, the value is changed.
char *List Pointer to a String containing a list of the various elements , separated by chr(0)
int LenList Total size of the String
int NumberOfElements String's elements number

Followed by 'Enter'
the name 'ze Carioca' automatically is inserted from a screen "USERS", as the user 'Ze Carioca' is user's number 1.


Password = Chr(0) + Space(10)
User= 0
T_Cls
T_ActivateListIndex "Useful list"
T_PrintInverse "LOGIN"
T_NewLine


T_Say "Use:"
T_GetTextFromList User, 10, "USERS"
T_NewLine


name= UserList(User)


T_Say "Password:"
T_GetText Password, 10, GetText_flag_ExitEnter + GetText_flag_Underline
T_NewLine
T_Beep 50, 50
T_Read


The function GetTextFromList accepts a number as input.


On the Horizontal Terminal :
If you press the key '.' , the screen ScreenName is automatically called.


On the Vertical Terminal :
The Function keys show a '?' .
If you press the key 'F1', the screen ScreenName is automatically called.

In this situation the value in 'number' is used to position the new screen.

If there is a value on the new screen in the (campo (Value de PutTextOnList) = number) the cursor will place itself there.

If a list is created with the right functions, when inserting a number followed by Enter, the text corresponding to that list will be displayed.

To defice the aspect of the input line, you can use the function T_SetGetTextFromListFlags. This function defines the aspect of GetTextFromList in all future occurencies.


int __stdcall T_GetTextFromList(int *number,int size,char *ScreenName);
int *number pointer to an element.
int size imput field size


hours= Time
T_Cls
T_PrintString ("Actual Hour:")
T_NewLine
T_PrintLarge hours
T_NewLine
T_NewLine
T_NewLine
T_NewLine
T_Beep 50, 50
key = T_WaitChar
T_GotoScreen "MENU"




T_Cls
T_PrintInverse "PERSONAL DETAILS"
T_NewLine
T_Say "Name: "
T_GetText nome, 10, GetText_flag_Underline
T_NewLine
T_NoSay 5
T_GetText tel, 10, GetText_flag_Underline
T_NewLine
T_Read




T_Cls
T_PrintInverse "MEAT"
T_NewLine
T_NewLine
T_Say "1-steak"
T_GetLink "Steak", 0, Asc("1")
T_NewLine
T_PutTextOnList "Beans", 12, Asc("2")
T_NewLine
T_PutTextOnList "Eggs", 13, Asc("3")
T_NewLine
T_PutTextOnList "cutlets", 14, Asc("4")
T_NewLine
T_Beep 50, 50
T_Read

int __stdcall T_PutTextOnList(char *txt,int Value,char FastKey);

char *txt text which returns to T_GetTextFromList after pressing enter.
int Value value which returs to T_GetTextFromList after pressing enter.
char FastKey quick access key.

Remarks:

If you do T_ActivateListIndex before executing the screen, then, an automatic index will be created.
When making T_GetTextFromList if an index exists and if you introduce a valid number, when doing enter, the field will be automatically substituted by the valid text.



Press Enter and



The screen is redesigned with the orders line increased 3 *


T_Cls
T_PrintInverse "ORDER"
T_ActivateListIndex "FOOD LIST"
T_NewLine
T_PrintString "Dish Qty"
T_NewLine
T_StartRepeat OrdersNumber For n = 1 To OrdersNumber
T_NoSay 15
T_GetTextFromList dishes(n), 15, "LIST"
T_PrintString " "
T_NoSay 4
T_GetNumerical qt(n), 4, 0
T_NewLine
T_EndRepeat
Next
T_Say "(+++)"
T_GetRepeat 3
T_NewLine
T_Read

When doing GetRepeat the code StartRepeat and EndRepeat is repited n times.
In the example above, the orders line is increased 3 times.



Dim nome As String
Dim tel As String
tel = Chr(0) + Space(10)
nome= Chr(0) + Space(10)

T_InitScreen TerminalId, "TEST", scr_flag_execute, 0, 0
T_Cls
T_PrintInverse "PERSONAL DETAILS"
T_NewLine
T_Say "Name: "
T_GetText name, 10, GetText_flag_Underline
T_NewLine
T_Say "Tel : "
T_GetText tel, 10, GetText_flag_Underline
T_NewLine
T_Read


T_SendScreen


ScrFlags


#define scr_flag_execute 1
When sending a screen to the terminal with this attribute, the terminal stops receiving screen and executes this one.


#define scr_flag_changed 2
Not used

#define scr_flag_update_pc_if_possible 4
The terminal sends this screen to the PC through radio, but just tries it once. If unsuccessfull, it saves the data in an internal buffer and sends them when possible to do so.

#define scr_flag_update_pc_now 8
The terminal sends this screen to the PC through radio, and it tries always.
If unsuccessfull, it gets stuck until it gets into a location with network.


#define scr_flag_update_pc_later 16
The terminal sends this screen to the PC through radio, but not yet.
Puts the details into a sending buffer but it doesn't try to send.

#define scr_flag_auto_destroy 32
Once displayed, this screen looses validity in the terminal.


#define scr_flag_ask_pc_answer 64
Not used.

#define scr_flag_ask_pc_update 128
Not used.

#define scr_flag_restore_fields_after_send 256
After sending by radio, this screen returns to its initial aspect.

#define scr_flag_dont_stop 512
To be used when you wish to send a screen to ther terminal, and you want it to be executed without having the terminal stopping.

Very useful if you are sending to the terminal screen with lists so that the terminal learns them.

T_PutTextOnList


Text flags


#define text_flag_Protected -1
This field cannot be edited.

#define text_flag_AutoExit -2
If the cursor is in the last position, it will disapear.

#define text_flag_Password -4
****
#define text_flag_Number -8
Just accept numbers

#define text_flag_ExitEnter -16
With Enter the Screen ends

#define text_flag_ExitAlways -32
when leaving the field, it will terminate the screen


#define text_flag_Barcode -64
turns on the Barcode

#define text_flag_NotUnderline -128
shows the filed not underlined field of input


#define text_flag_Link -256
Do not use

#define text_flag_NewText -512
Clears the text

#define text_flag_NumberRightAligned -1024
Align a number to the right


#define text_flag_DontShowZero -2048
If the field has a value of 0, it will not show anything

 

#define text_flag_ForceFunctionKeys -4096
Show the function keys defined with the function T_SetFunctionKeys

If you press a function key the terminal will go to the screen T_OnFxGotoScreen

#define text_flag_NoFunctionKeys -8096
#define Text_flag_AutoexitfieldON -16384
Equivalent to AutoExit , but gets out in the last field

#define Text_flag_OnlyExitIfTemplateOK -32768
If using templates to read barcodes, it will only leave this field it the rading is ok.

#define Text_flag_ScreenIndex -65536
Always use in conjuntion with the function T_CreateOrEditScreenIndexOnLastNumericalValue, to define which value should be used as index.



T_Cls
T_PrintInverse "VARIABLES"
T_NewLine
T_WriteVariable "VALUE1", 12
T_WriteVariable "UNIT", 1
T_AddVariable "VALUE1", "VALUE1", "UNIT"
T_Say "Result ."
T_GetVariable "VALUE1", 10, 0
T_Read

The variables used in the terminal are local to ther terminal. They are located in the terminal's memory. They are independent from the screen.

To maintain a variable in memory between terminal resets, the variables should be reserved on the first screen.



T_ReserveVariable


You can use the conditional functions to have small program running on the terminal without having to come back to the PC.

Variable functions

T_ReserveVariable
int __stdcall T_ReserveVariable(char *VariableName);

T_WriteVariable
int __stdcall T_WriteVariable(char *VariableName,int valor);

T_ReadVariable
int __stdcall T_ReadVariable(char *VariableName);

T_AddVariable
int __stdcall T_AddVariable(char *VariableNameDest,char *VariableNameSrc1,char *VariableNameSrc2);

T_MulVariable
int __stdcall T_MulVariable(char *VariableNameDest,char *VariableNameSrc1,char *VariableNameSrc2);

T_DivVariable
int __stdcall T_DivVariable(char *VariableNameDest,char *VariableNameSrc1,char *VariableNameSrc2);

T_IfVar1EqVar2Goto
int __stdcall T_IfVar1EqVar2Goto(char *VariableName1,char *VariableName2,char *ScreenName);

T_IfVar1GreaterVar2Goto
int __stdcall T_IfVar1GreaterVar2Goto(char *VariableName1,char *VariableName2,char *ScreenName);

T_IfVar1LessVar2Goto
int __stdcall T_IfVar1LessVar2Goto(char *VariableName1,char *VariableName2,char *ScreenName);

T_IfVar1NotEqVar2Goto
int __stdcall T_IfVar1NotEqVar2Goto(char *VariableName1,char *VariableName2,char *ScreenName);

 

Goto functions

T_GotoScreen
int __stdcall T_GotoScreen(char *ScreenName);


When this command is executed the terminal changes to the screen "ScreenName"

T_OnEscapeGotoScreen
int __stdcall T_OnEscapeGotoScreen(char *ScreenName);


When the user presses the Esc key the terminal shows the screen "ScreenName"

T_OnF1GotoScreen
int __stdcall T_OnF1GotoScreen(char *ScreenName);


When the user presses the F1 key, the terminal shows the screen "ScreenName"
The function keys should be defined with the function "T_SetFunctionKeys" and activated in a input field with a text_flag GetText_flag_ForceFunctionKeys.

T_OnF2GotoScreen
int __stdcall T_OnF2GotoScreen(char *ScreenName);


When the user presses the F2 key ther terminal shows the screen "ScreenName"
The function keys should be defined with the function "T_SetFunctionKeys" and activated in an input field with a text_flag GetText_flag_ForceFunctionKeys.


T_OnF3GotoScreen
int __stdcall T_OnF3GotoScreen(char *ScreenName);


When the user presses the F3 key the terminal shows the screen "ScreenName"
The function keys should be defined with the function "T_SetFunctionKeys" and activated in an input field with a text_flag GetText_flag_ForceFunctionKeys.


T_OnF4GotoScreen
int __stdcall T_OnF4GotoScreen(char *ScreenName);


When the user presses the F4 key, the terminal shows the screen "ScreenName"
The function keys should be defined with the function "T_SetFunctionKeys" and activated in an input field with a text_flag GetText_flag_ForceFunctionKeys.



T_IfVar1EqVar2Goto
int __stdcall T_IfVar1EqVar2Goto(char *VariableName1,char *VariableName2,char *ScreenName);


If the content of the variavel1 = variavel2 the terminal shows the screen "ScreenName"


T_IfVar1GreaterVar2Goto
int __stdcall T_IfVar1GreaterVar2Goto(char *VariableName1,char *VariableName2,char *ScreenName);


If the content of the variavel1 > variavel2 the terminal shows the screen "ScreenName"


T_IfVar1LessVar2Goto
int __stdcall T_IfVar1LessVar2Goto(char *VariableName1,char *VariableName2,char *ScreenName);

T_IfVar1NotEqVar2Goto
int __stdcall T_IfVar1NotEqVar2Goto(char *VariableName1,char *VariableName2,char *ScreenName);


If the content of the variavel1 variavel2 then the terminal shows the screen "ScreenName"

Offline screen duplication functions


T_MarkScreenAsChanged
int __stdcall T_MarkScreenAsChanged()


This function permits marking the current screen so that later it may be sent with the function T_SendChangedScreensToPc.


T_ReadCurrentScreenIndex
int __stdcall T_ReadCurrentScreenIndex()


This function returns the index value of the screen.
If the screen is created with the function:

T_CreateOrEditScreenIndexOnLastCursorPosition

The index will be the last position of the cursor before call the screen.

T_CreateOrEditScreenIndexOnLastNumericalValue

The index will be the value of the last variable read with GetNumerical.

T_CreateOrEditScreenIndexOnLastCursorPosition
int __stdcall T_CreateOrEditScreenIndexOnLastCursorPosition(char *ScreenName)


Creates and jumps to a copy of the screen indexed by the cursor's position ( Number line).
Attention, the original screen has to be in memory.

T_CreateOrEditScreenIndexOnLastNumericalValue
int __stdcall T_CreateOrEditScreenIndexOnLastNumericalValue(char *ScreenName)


Creates and jumps to a copy of the screen indexed by the last numerical variable edited.
The edited variable has to be numeric and must have the flag GetText_flag_ScreenIndex (65536) active.

GetNumerical &var,len,GetText_flag_ScreenIndex

Attention, the original screen has to be in memory.


T_SendChangedScreensToPc
int __stdcall T_SendChangedScreensToPc(int scr_flags)


Sends all the marked screens with a T_MarkScreenAsChanged and all the new created screens ( T_CreateOrEditScreenIndexOnLastCursorPosition or T_CreateOrEditScreenIndexOnLastNumericalValue).

Browse Functions

The following functions should be used in conjunction, and terminated, with the função T_Read.


T_Read
int __stdcall T_Read();


This function is equivalent to the already old Read function of the clipper.
After a series of T_Say and T_Get... you should terminate with a T_Read.

The terminal when executes a T_Read stops and gives to the user the possibility of editing the input fields.
To get out of T_Read you should press Esc, or T_Gets, or T_GetCheckEnter.

This function returns the line on which we were when doing Read.


T_Say

int __stdcall T_Say(char *txt);


You must use this function in conjunction with T_Get... and T_Read.
When doing T_Read the cursor get positioned on the text of the T_Say, and permites execute the T_Get...


T_NoSay
int __stdcall T_NoSay(unsigned char size);


Should be used in conjunction with T_Get... and T_Read.
Should be used when you wish to have the cursor on the input filed with a size.


T_Scroll
int __stdcall T_Scroll(char *txt_fix,char *txt_rot);


Should be used in conjuntion with T_Get... and T_Read.
Print the txt_fix and if the cursor is stopped on top passes the txt_rot.


The follwoing functions must be used in conjunction with and terminated with the function T_Read and then follow one of the previous functions.

T_GetText
int __stdcall T_GetText(char *txt,int size,int flags);


'txt' should be a pointer to a zone of free memory to receive the text with 'size'.
In VB we should declare a variable of string type and then initiate it with spaces. In order for the DLL to assume that the string is empty we should start with Chr(0) just like in the previous example.


T_GetTextTemplate
int __stdcall T_GetTextTemplate(char *txt,char *templates,int flags)


'txt' should be a pointer to a zone of free memory to receive the text with strlen(template).

In VB a variable string type should be declared and then initiated with spaces. So that the DLL assumes that the variable is empty we should start with the chr(0) as on the previous example.

In the template field, we should create a mask with the valid characteres.


Example:

T_Say "5 Alpha :"
T_GetTextTemplate barcode, "%%%%%", GetText_flag_Barcode
T_NewLine

T_Say "5 Alpha/Num :"
T_GetTextTemplate barcode, "@@@@@", GetText_flag_Barcode
T_NewLine

T_Say "5 Num :"
T_GetTextTemplate barcode, "#####", GetText_flag_Barcode
T_NewLine

T_Say "5 Q+4 :"
T_GetTextTemplate barcode, "Q###", GetText_flag_Barcode
T_NewLine


T_GetTextFromList
int __stdcall T_GetTextFromList(int *number,int size,char *ScreenName);

T_GetTextFromList2
int __stdcall T_GetTextFromList(int *number,int size,char *ScreenName,char *ListName,int flags);

Equivalent to GetTextFromList but it permits the alteration as flags and the activation of a different list.
The GetTextFromList works always with a list previously activated and with the flags pre-activated.

T_GetNumerical
int __stdcall T_GetNumerical(int *Number,int size,int flags);

Equivalent to GetText but receives an int of 32 bits instead of a string.
Size is the actual size of the input field.
T_GetLink
int __stdcall T_GetLink(char *ScreenName,int Value,char FastKey);

In this option, when you press Enter the screen "ScreenName" shows.
If you press a FastKey the cursor changes to a GetLink equivalent and calls the screen "ScreenName"

Example 2.

T_GetCheckEnter
int __stdcall T_GetCheckEnter();


To be used with T_Say.
Exp.
T_Say "OK"
T_GetCheckEnter

It makes the cursor (if in 'OK' and the 'Enter' key is pressed) to leave the screen


T_GetEditDate
int __stdcall T_GetEditDate();

Enables the user to change the date on the terminal.

T_GetEditTime
int __stdcall T_GetEditTime();

Enables the user to change the hour on the terminal.

T_ShowDate
int __stdcall T_ShowDate();

T_ShowTime
int __stdcall T_ShowTime();

T_ShowWeekDay
int __stdcall T_ShowWeekDay();

T_GetOption
int __stdcall T_GetOption(int *position,char *List,int LenList,int NumberOfElements);

This option enables the selection of an element from a list. For example, a 'Yes' or 'No'.


T_GetOptionGotoScreen
int __stdcall T_GetOptionGotoScreen(int *position,char *List,int LenList,int NumberOfElements,char *ScreenList);

This option enables the selection of an element from a list and jumps to a screen related to the selected element. The list elements should be separated by Chr(0), as well as the elements of the screen.

Example:
T_GetOptionGotoScreen ( position, "Yes"+chr(0)+"No"+chr(0) , 8 , 2 , "Ecran1"+chr(0)+"Ecran2"+chr(0) )

In this example, when leaving the T_Read, the program jumps to the ecran1 or ecran2 based on the selection of 'Yes' or 'No '

T_GetVariable
int __stdcall T_GetVariable(char *VariableName,int size,int flags);

Function equivalent to T_GetNumerical but with local terminal variables.
Enables the user to edit the value terminal's local variable.


T_StartRepeat
int __stdcall T_StartRepeat(int *times);

T_EndRepeat
int __stdcall T_EndRepeat();

T_GetRepeat
int __stdcall T_GetRepeat(unsigned char times);

T_GetExitNow
int __stdcall T_GetExitNow()

The terminal leaves the function T_Read if the cursor is on top of this line.

T_ExitReadWithRadio
int __stdcall T_ExitReadWithRadio()


The terminal, once finished doing Read(), stays with the keypad active so that we may browse the screen. The radio module stays in receiving mode. If the PC sends a screen to the terminal when in this situation, the terminal goes to instruction read, which should be: T_WaitAnyScreenFromPc.

Attention:
The use of this function should be pondered because the terminal gets to consume too much ( 30 mA ), being the normal consumption of 1 mA.
The keypad gets to work slidly worst.

T_OnRadioGotoScreen
int __stdcall T_OnRadioGotoScreen(char *ScreenName)


This function should be used in conjuntion with the function T_ExitReadWithRadio. In this situation T_WaitAnyScreenFromPc should not be used.
It should be used in conjuntion with Read().

T_OnTimerGotoScreen
int __stdcall T_OnTimerGotoScreen(int timer,char *ScreenName)


Enables the calling of a screen on the background within the Read(). The timer is the time in seconds.

This function should be used alone, because internally it contains a T_say and a T_Get...

T_PutTextOnList
int __stdcall T_PutTextOnList(char *txt,int Value,char FastKey);

RFID functions