Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Type

Format

Description

Subroutine

FrameOpen(“FrameFile”)

Opens the frame file.

Function

GetExplorerPath(“PathType”)

Returns the recently selected file’s path.

Function

IsDirectory(“File or Folder Name”)

Checks if the file or folder exists in the Xpanel.

Function

NumToAsc(Decimal value)

Converts a decimal value to an ASCII code value.

Function

NumToStr(TargetValue, Value Type, Format)

Converts the numeric value to a string.

Subroutine

PageOpen(“PageName”)

Opens the page.

Subroutine

PrePage()

Moves to the previous page.

Subroutine

PrePageEx()

Moves to the previous base page.

Subroutine

RunApp(“ProgramName”, “ProgramParameter”)

Executes the external program.

Subroutine

ScrCapture(“SeedName”, Location)

Saves the Xpanel screen in a BMP file.

Subroutine

SetSpeed(Acc./Dec.)

Controls the process time of the script module.

Subroutine

Sleep(Delay)

Delays the script program.

Subroutine

SoftKeyboard(Show/Hide, X Coordinate, Y Coordinate)

Opens or closes the virtual keyboard.

Function

StrToNum(Target String, Numeral System)

Converts the string to the numeric value.

Subroutine

TimeStr(Acquired Value, “Format”)

Generates the time-displaying string.

...

IsDirectory

Checks if the file or folder exists in the Xpanel.

Function

n=IsDirectory(“File or Folder Name”)

Description

Checks if the file or folder exists in the Xpanel. The parameter must be entered with the double quotation marks.

If the file or folder exists, the function will return 1. If not, the function will return 0.

Example

Checks if USB Storage folder exists in Xpanel.

VAR FolderCheck;

FolderCheck = IsDirectory(“USB Storage”);

 

NumToAsc

Converts a decimal value to an ASCII code value.

Function

ASC = NumToAsc(Decimal Value)

Description

Returns the ASCII code value of the converted decimal value.

Example

1) When there is a string tag named “ASC” and an analog tag named “ANA”:

ASC= NumToAsc(ANA);

The ASCII content of the current analog tag value “ANA” is entered in the string tag “ASC”.

2) If the variables are directly registered and used in the script:

VAR ASC, ANA;

ANA=49;

ASC=NumToAsc(ANA);

Returns the ASCII code value of the decimal value 49, which is the letter “1”. In this case, “1” is not a numeric value.

NumToStr

Converts the numeric value to the string.

Function

STR=NumToStr(TargetValue, Value Type, Format)

Description

Recognizes the TargetValue as the data in Value Type. Then the value will be converted according to the Format.

This function supports Value Type as shown below.

_UINT_ : Unsigned Integer

_INT_ : Signed Integer

_FLOAT_ : Floating-Point

_HEX_ : Hexadecimal

Format must be written in the configuration as shown below.

[Width] [. precision]

Width: Assign the number of letters to be returned after the conversion. If you enter 3, the converted string will be composed of 3 letters. If the original value is greater than the Width value, the more significant digits will be deleted. In the opposite case, the spaces will be filled. If the Width contains a leading-zero, the spaces will be replaced with the zeros.

Precision: Assign the Precision when you convert the floating-point number. Assign the significant digits for the decimal points to be converted. Precision must be smaller than the Width.

Example

Stores 123 to Val1, 0123 to Val2, 123.46 to Val3.

VAR Val1, Val2, Val3;

Val1 = NumToStr(123.456, _FLOAT_, “3.0”);

Val2 = NumToStr (123.456, _FLOAT_, “04.0”);

Val3 = NumToStr (123.456, _FLOAT_, “6.2”);

……

...