Variables / register #V

Command group to execute calculations and logical operations. With the help of the string files, internationalization (multiple languages) can be realized. There are registers for numbers and strings (can record characters up to 200), integer registers use signed 32-bit, floating-point registers use 23-bit mantissa, 8-bit exponent, 1-bit signed.


String file / multilingualism

Load string file

(Variable stringFile Load)

#VFL

StringfileName>

Delete string file

(Variable stringFile Delete)

#VFD

<StringfileName> (all)

Send number of loaded string files

(Variable stringFile Count)

#VFC


String register

Set string register

(Variable Stringregister Set)

#VSS

String-ID, "String"; "String" [ID+1]; ...

Set string register from position

(Variable Stringregister Postion)

#VSP

String-ID, Offset, "New String";

Replace string register from position

(Variable Stringregister Replace)

#VSR

String-ID, Offset, "New String";

Cut out and replace sub-string from string register

(Variable Stringregister Truncate)

#VST

String-ID, Offset, Number(until end)

Copy sub-string from string register

(Variable Stringregister Copy)

#VSC

String-ID Target, String-ID Source, Offset (0), Number(until end)

split string registers in sub-strings

(Variable Stringregister dElimiter)

#VSE

String-ID Target Start, String-ID Source, Seperator, Register-ID (=String-ID Target Start)

Set string register with date/time

(Variable Stringregister Date)

#VSD

String-ID, "Dateformat"; date (act. time)

Set formatted string register

(Variable Stringregister Formated)

#VSF

String-ID, "Formatted string"; Value, Value2, ...., ValueN

Read object strings

(Variable Stringregister Object)

#VSO

String-ID, Obj-ID, ...

Send string register (ASCII)

(Variable string Send Ascii)

#VSA

String-ID, ...

Send string register (Unicode)

(Variable string Send Unicode)

#VSU

String-ID, ...

Sort string register

(Variable Quicksort Strings)

#VQS

String-ID Start, String-ID End, Number (0), Offset(0)

Sort codes in string register

(Variable Quicksort Codes)

#VQC

String-ID, Direction (1), Number (0), Offset (0)

Last error message in string register

(Variable Stringregister Last error)

#VSL

String-ID, Delete(1)

Mix string register

(Variable Mix Strings)

#VMS

String-ID Start, String-ID End

Mix codes in string register

(Variable Mix Codes)

#VMC

String-ID, Number (0), Offset (0)

Register

Set register (integer)

(Variable Register Integer)

#VRI

Register-ID, Value, Value1 [ID+1], ...

Set register (float)

(Variable Register Float)

#VRF

Register-ID, Value, Value1 [ID+1], ...

Convert object string

(Variable Register Object)

#VRO

Register-ID, Obj-ID, Obj-ID1[ID+1], ...

Convert string register to register

(Variable Register dElimiter)

#VRE

Register-ID Start, String-ID Source, Seperator, Register-ID Name

Write register to RTC-RAM

(Variable Register rtc Write)

#VRW

ID, Register-ID, Register-ID1, ...

Read register from RTC-RAM

(Variable Register rtc Read)

#VRR

ID, Register-ID, Register-ID1, ...

Convert string register as calculation to register (integer)

(Variable Calculate Integer)

#VCI

Register-ID, String-ID, String-ID1[ID+1], ...

Convert string register as calculation to register (float)

(Variable Calculate Float)

#VCF

Register-ID, String-ID, String-ID1[ID+1], ...

Send register

(Variable Register Send)

#VRG

Register-ID, ...

Sort register

(Variable Quicksort Register)

#VQR

Register-ID Start, Register-ID End

Mix register

(Variable Mix Register)

#VMR

Register-ID Start, Register-ID End

Array

Define array (Integer)

(Variable Array Integer)

#VAI

Array-ID, Number, Type(0)

Define array (Float)

(Variable Array Float)

#VAF

Array-ID, Number, Type(0)

Delete array (free memory)

((Variable Array Delete)

#VAD

Array-ID

Fill array

(Variable Array Set)

#VAS

Array-ID, Value(0, all Elements)

Assign values to array elements (with index)

(Variable Array Value)

#VAV

Array-ID, Index, Value, Value[Index+1], ...

Assign values to array elements (with current write pointer)

(Variable Array Write)

#VAW

Array-ID, Value 1, Value 2, ...

Set writing and/or reading pointer

(Variable Array Pointer)

#VAP

Array-ID, WritePointer, ReadPointer(-1)

Sort array

(Variable Quicksort Arrays)

#VQA

Array-ID, StartIndex, EndIndex(last Index)

Mix array

(Variable Mix Arrays)

#VMA

Array-ID, StartIndex, EndIndex(last Index)

String file / multilingualism

"Hello World" is placed in 4 different languages. It must be ensured that the selected font supports all necessary characters. In the following example "Arial Unicode MS" was used. The commands below assume that the string files (Chinese.txt, English.txt, Cyrillic.txt and German.txt) are already available on FLASH in the project path in the string's subfolder:

...

#VFL <P:string/German.txt>  

#SSP 1,1,10,10,7,!HELLO!;

#VFD  

#VFL <P:string/English.txt>  

#SSP 2,1,10,50,7,!HELLO!;

#VFD                      

#VFL <P:string/Cyrillic.txt>  

#SSP 3,1,10,90,7,!HELLO!;

#VFD  

#VFL <P:string/Chinese.txt>  

#SSP 4,1,10,130,7,!HELLO!;

#VFD  

...


Load string file

#VFL

<StringfileName>

Load a set of strings. A maximum of 1000 strings from 8 different files can be loaded at the same time.


Delete string file

#VFD

<StringfileName> (alle)

Delete a set of strings or all. The files are physically retained on FLASH so that they can be reloaded.


Send number of loaded strings

#VFC

Places the number of loaded strings in the send buffer. The feedback is structured as follows:

ESC

V

F

C

Number

...


$1B

$56

$53

$43

16-Bit value

...

#VFL ...

#VFL ...

#VFL ...

#VFL ...

#VFC

...

String register

Set string register

#VSS

String-ID, "String"; "String" [ID+1]; ...

The command saves the String in the register set (String ID [0 ... 499]).

String-ID

Value

0

"Hello World"

1

"Test Hello World"

2

"Hello World Test"

...

#VSS 0,"Hello World";"Test "S0;S0" Test";

...


Set string register from position

#VSP

String-ID, Offset, "New String";

The string of the location String-ID is deleted from the position offset and the new data ("New String") are added.

String-ID

Value

0

"Hello Test"

1

...

2

...

...

#VSS 0,"Hello World";

#VSP 0,6,"Test";

...

Replace string register from position

#VSR

String-ID, Offset, "New String";

The string of the location String-ID is replaced with the new data (("New String") from the position offset.

String-ID

Value

0

"Hello Test"

1

...

2

...

...

#VSS 0,"Hello World";

#VSR 0,6,"Test";

...

Cut out and replace sub-string from string register

#VST

String-ID, Offset, Count(until end)

Delete the "left" part of the string register and move the part from offset to offset + count to the front. If count is negative, count is taken as second offset. It is then an area specification.

String-ID

Value

0

"World"

1

...

2

...

...

#VSS 0,"Hello World";

#VST 0,6,5

...


...

#VSS 0,"Hello World";

#VST 0,6-10

...


Copy sub-string from string register

#VSC

String-ID Target, String-ID Source, Offset (0), Count(until end)

Copy a substring from the string (String-ID Source), starting with the Offset and length Count, and paste it into another string register (String ID Target).

String-ID

Value

0

"Hello World"

1

"World"

2

...

...

#VSS 0,"Hello World";

#VSC 1,0,6,5

...


...

#VSS 0,"Hello World";

#VSC 1,0,6-10

...


Split string register in sub-strings

#VSE

String-ID Targer Start, String-ID Source, Seperator, Register-ID (=String-ID Targert Start)

The string (String-ID Source) is split into substrings. The substrings are stored from the String ID Target Start. The number of substrings is stored in the Register-ID. The Seperator parameter specifies the separator.


String-ID

Value

0

"Entry1,Entry2,Entry3"

1

"Entry1"

2

"Entry2"

3

"Entry3"


Register-ID

Value

10

3

...

#VSS 0,"Entry1,Entry2,Entry3";

#VSE 1,0,?,,10

...


Set string register with date/time

#VSD

String-ID, "Dateformat"; date (act. time)

The time is stored in the string register as a formatted string. The presentation is based on the Dateformat. The structure is described in more detail in the sub-chapter Date formats.

String-ID

Value

0

...

1

"14:59:30"

2

...

...

#VSD 1,"%h:%m:%s";

...

Set formatted string register

#VSF

String-ID, "Formatted string"; Value, Value2, ...., ValueN

A formatted string is stored in the string register (String-ID). If the variable set is repeated, the format string is used again and stored in String-ID + 1

String-ID

Value

0

...

1

"Analog 3420"

2

...

...

#VSF 1,"Analog %d";(analog(0))

...


Read object strings

#VSO

String-ID, Obj-ID, ...

Object strings (Obj-ID) are stored in the string register (String-ID). This function is mainly used for EditBoxes.

String-ID

Value

0

...

1

"edit me"

2

...

...

#SED 1,"edit me"     /**Default text for EditBox

#VSO 1,1

...

Send string register (ASCII)

#VSA

String-ID, ...

Place the content of the string register (ASCII formatted) in the send buffer. The feedback is structured as follows:

ESC

V

S

A

String-ID

Length

Char 1

Char 2

...

Char n

...


$1B

$56

$53

$41

16-Bit value

16-Bit value

8-Bit value

8-Bit value

8-Bit value

8-Bit value

...

#VSS0,"str";

#VSA 0

...


Send string register (Unicode)

#VSU

String-ID, ...

Place the content of the string register (Unicode formatted) in the send buffer. The feedback is structured as follows:

#

V

S

U

String-ID

Length

Char 1

Char 2

...

Char n

...

$1B

$56

$53

$55

16-Bit value

16-Bit value

16-Bit value

16-Bit value

16-Bit value

16-Bit value

...

#VSS0,"str";

#VSU 0

...

Sort string register

VQS

String-ID Start, String-ID End, Number (0), Offset(0)

The area of the string register (String-ID Start to String-ID End) is sorted. Number specifies the area that is considered for the sorting, with number = 0 the entire length is examined. Offset specifies the position in the string where the sorting begins.

String-ID

Value before

Value after

0

"Sort"

"Entry"

1

"Test"

"Exit"

2

"Entry"

"Sort"

3

"Exit"

"Test"

...

#VSS 0,"Sort";"Test";"Entry";"Exit";

#VQS 0,3,2,0

...


Sort codes in string register

VQC

String-ID, Direction (1), Number (0), Offset (0)

Codes within the string register (String-ID) are sorted. Number specifies the area that is considered for the sorting, with number = 0 the entire length is examined. Offset specifies the position in the string from which the sorting begins. The direction can also be specified:

Direction

0

Descending

1

Ascending

String-ID

Value

0

...

1

" HWdellloor"

2

...

...

#VSS 1,"Hello World"

#VQC 1

...


Last error message in string register

#VSL

String-ID, Delete(1)

Save the error messages from the terminal in a string register (String-ID). The parameter Delete specifies the deletion behavior of the error message:

Delete

0

Do not delete

1

Delete


Mix string register

#VMS

String-ID Start, String-ID End

The content of the registers remains, only the String-ID changes. A new assignment of string ID ⇔ content is now available.


Mix codes in string register

#VMC

String-ID, Number (0), Offset (0)

The content of a string register (String-ID) is interchanged randomly.

Number indicates the number of digits (= 0 complete string), Offset the starting point within the register.


Register

Set register (Integer)

#VRI

Register-ID, Value, Value1 [ID+1], ...

The command saves an integer value (32 bits) in the register set (Register-ID [0 ... 499]).

Register-ID

Value

0

10

1

42

2

-8

...

#VRI 0,10,42,-8

...


Set register (float)

#VRF

Register-ID, Value, Value1 [ID+1], ...

The command saves a float value (32 bit) in the register set (Register-ID [0 ... 499]).


Register-ID

Value

0

10.25

1

42.39

2

-8.19

...

#VRF 0,10.25,42.39,-8.19

...


Convert object string

#VRO

Register-ID, Obj-ID, Obj-ID1[ID+1], ...

Object strings are stored in registers. The object string is converted into a numerical value (automatically fitting as an integer or float). This function is mainly used for EditBoxes.

Register-ID

Value

0

...

1

42.5

2

...

...

#SED 1,"42.5"     /**Default text for EditBox

#VRO 1,1

...



Convert string register to register

#VRE

Register-ID Start, String-ID Source, Seperator, Register-ID Number

Convert numeric string (String-ID Source) to register (Register-ID Start). Separator specifies the separator between the values. The number of valid values after the conversion is specified in the optional parameter Register-ID Number

Register-ID

Value

0

10

1

42.39

2

-8

10

3

...

#VSS 0,"10,42.39,-8";

#VRE 0,0,?,,10

...


Write register to RTC-RAM

#VRW

ID, Register-ID, Register-ID1, ...

Buffer a Register-ID in the RAM of the RTC. ID [0 ... 7] indicates the storage space. The value is retained even after the module is switched off. A RTC needs to be connected (Attention: EA uniTFTs020-ATC and EA uniTFTs028-ATC).


Read register from RTC-RAM

#VRR

ID, Register-ID, Register-ID1, ...

Read back a value from the RTC-RAM (ID) and transfer it to the register (Register-ID). A RTC needs to be connected (Attention: EA uniTFTs020-ATC and EA uniTFTs028-ATC).


Convert string register as calculation to register (integer)

#VCI

Register-ID, String-ID, String-ID1[ID+1], ...

Interpret the content of a string register as a calculation string. The result is stored in the register (Register-ID)

Register-ID

Vaule

0

-8

1

50

2

42

...

#VSS 0,"R0+R1";

#VCI 2,0

...


Convert string register as calculation to register (float)

#VCF

Register-ID, String-ID, String-ID1[ID+1], ...

Interpret the content of a string register as a calculation string. The result is stored in the register (Register-ID)

Register-ID

Value

0

-8.21

1

50.89

2

42.68

...

#VSS 0,"R0+R1";

#VCF 2,0

...


Send register

#VRG

Register-ID, ...

Place the contents of the register in the send buffer. The feedback is structured as follows:

ESC

V

R

G

Register-ID

Type

Value

...


$1B

$56

$52

$47

16-Bit value

16-Bit value

32-Bit value

...

#VRF 0,...

#VRG 0

...


Sort register (from V1.1)

#VQR

Register-ID Start, Register-ID End

The area of the registers (Register-ID Start to Register-ID End) are sorted.

Register-ID

Value before

Value after

0

2

-5

1

8

2

2

4

4

3

-5

8

...

#VRI 0,2,8,4,-5

#VQR 0,3

...


Mix register (from V1.3)

#VMR

Register-ID Start, Register-ID End

The content of the registers remains, only the Register-ID changes. A new assignment of Register-ID ⇔ content is now available.


Array (from V1.4)

Define array (Integer)

#VAI

Array-ID, Number, Type(0)

The command defines an integer array (Array-ID [0 ... 499]) with the given Number of entries. The maximum length of the array respectively if the array has the desired length, can be checked with the calculation arE(). The Type specifies the behaviour when writing at the end of the array.

Type

0

Stop at end

1

Wrap around (ring buffer)



Define array (Float)

#VAF

Array-ID, Number, Type(0)

The command defines a float array (Array-ID [0 ... 499]) with the given Number of entries. The maximum length of the array respectively if the array has the desired length, can be checked with the calculation arE(). The Type specifies the behaviour when writing at the end of the array.

Type

0

Stop at end

1

Wrap around (ring buffer)



Delete array (free memory)

#VAD

Array-ID

The command deletes an array (Array-ID [0 ... 499]) and releases the memory.


Fill array

#VAS

Array-ID, Value(0, all Elements), element index

The command fills all elements of the array (Array-ID [0 ... 499]) with the given Value. If  Value paramter is not sent, then the whole array is filled with 0. On the other hand the element index can specify which elements get the new value.


Assign values to array elements (with index)

#VAV

Array-ID, Index, Value, Value[Index+1], ...

The command assigns new Values to array elements, starting with the array Index.


Assign values to array elements (with current write pointer)

#VAW

Array-ID, Value 1, Value 2, ...

The command assigns new Values to array elements, starting with the current write pointer.


Set write and*or reading pointer

#VAP

Array-ID, WritePointer, ReadPointer(-1)

The command sets the Write and / or Read pointer of the array (Array-ID [0 ... 499]). If the pointer should remain unchanged, the respective parameter must be set to -1.


Sort array

#VQA

Array-ID, StartIndex, EndIndex(last Index)

The values of the array (Array-ID [0 ... 499]) are sorted in the specified range (StartIndex to EndIndex).


Shuffle array

#VMA

Array-ID, StartIndex, EndIndex(last Index)

The command shuffles the values of the array in the specified range (StartIndex to EndIndex). The values remain unchanged. Only the order (indexes) is adjusted. A new assignment of the array indexes ⇔ values is now available ....