OSCAT BASIC StringFunctions - RWTH-EBC/AixOCAT GitHub Wiki

13. String Functions

13.1. BIN_TO_BYTE

Type Function: BYTE
Input BIN: STRING (12) (Octal string)
Output BYTE (output value)
The function BIN_TO_BYTE converts a binary encoded string in a BYTE va-
lue. There, this method only binary characters are '0 'and '1' is interpre-
ted, others in BIN occurring characters are ignored.
Example: BIN_TO_BYTE ('11 ') result 3.

13.2. BIN_TO_DWORD

Type Function: DWORD
Input BIN: STRING (40) (Octal string)
Output DWORD (output value)
The function BIN_TO_DWORD converts a binary encoded string in a BYTE
value. There, this method only binary characters are '0 'and '1' is interpre-
ted, others in BIN occurring characters are ignored.
Example: BIN_TO_DWORD ('11 ') result 3.

13.3. BYTE_TO_STRB

Type Function : STRING
Input IN: BYTE (input)
Output STRING (8) (result STRING)
BYTE_TO_STRB convert a byte into a fxed-length STRING. The output
string is exactly 8 characters long and is the bitwise notation of the value
of IN. The output string consists of the characters '0 'and '1'. The least si-
gnifcant bit is right in the STRING. If a STRING is required with less than 8
characters, it can be truncated with the standard function RIGHT () accor-
dingly. The call RIGHT(BYTE_TO_STRB (X),4) results in a STRING with four
characters that correspond to the content of the lowest 4 bits of X.
Example: BYTE_TO_STRB(3) = '00000011 '

13.4. BYTE_TO_STRH

Type Function : STRING
Input IN: BYTE (input)
Output STRING(2) (result STRING)
BYTE_TO_STRH converts a byte into a fxed-length STRING. The output
string is exactly two characters long and is the hexadecimal notation of
the value of IN. The output string consists of the characters '0 ' '9' and
'A'  'F'. The least signifcant sign is right in the STRING.
Example :BYTE_TO_STRH(15) = '0F'

13.5. Capitalize

Type Function : STRING
Input STR: STRING (String input)
Output STRING (result STRING)
CAPITALIZE converts all frst letter on STR in capital letters. During conver-
sion, the Global Setup EXTENDED_ASCII constant is considered. If EXTEN-
DED_ASCII = TRUE, all characters of the extended ASCII character set to
be considered in accordance with ISO 8859-1.
Capitalize('peter pan') = 'Peter Pan'

13.6. CHARCODE

Type Function : BYTE
Input STR: STRING(10) (String input)
Output BYTE (character code)
CHARCODE returns the byte code of a Named Characters. A List the Codes
with Name located under the function charName. If no character known,
for the name in STR 0 is returned. If STR consists of only one character,
then the code of this character returned. CHARCODE uses the global va-
riables SETUP.CHARNAMES which include the list of names with codes.
Example: CHARCODE('euro') = 128 and corresponds to the character €
CHARCODE(',') = 44

13.7. CHARNAME

Type Function : STRING(10)
Input C: BYTE (character code)
Output STRING (character name)
CHARNAME determines the character name for a character code.
Example: CHARNAME(128) = 'euro'
If no name is known for a code, the code is returned as a single character.
For the Code 0 an empty string is returned. CHARNAME uses the global va-
riables SETUP.CHARNAMES which includes the list of names with codes.

13.8. CHR_TO_STRING

Type Function : STRING
Input C: Byte (input value)
Output STRING (result STRING)
charcode name charcode name charcode name
" 34 quot ½ 189 frac12 223
& 38 amp ¾ 190 frac34 224
< 60 ¿ 191 225
> 62 gt À 192 226
€ 128 Á 193 227
160 Â 194 228
¡ 161 Ã 195 229
¢ 162 cent Ä 196 230
£ 163 pound Å 197 231
¤ 164 Æ 198 232
¥ 165 yen Ç 199 233
¦ 166 È 200 234
§ 167 sect É 201 235
̈ 168 Ê 202 236
© 169 copy Ë 203 237
170 Ì 204 238
« 171 Í 205 239
¬ 172 not Î 206 240
173 shy Ï 207 241
® 174 reg Ð 208 ETH 242
̄ 175 Ñ 209 243
° 176 deg Ò 210 244
± 177 Ó 211 245
² 178 sup2 Ô 212 246
³ 179 sup3 Õ 213 ÷ 247 divide
́ 180 acute Ö 214 248
181 micro × 215 times 249
¶ 182 para Ø 216 250
· 183 Ù 217 251
̧ 184 Ú 218 252
¹ 185 sup1 Û 219 253
186 Ü 220 254 thorn
» 187 Ý 221 255
ß szlig
à agrave
lt iquest á aacute
Agrave â acirc
euro Aacute ã atilde
nbsp Acirc ä auml
iexcl Atilde å aring
Auml æ aelig
Aring ç ccedil
curren AElig è egrave
Ccedil é eacute
brvbar Egrave ê ecirc
Eacute ë euml
uml Ecirc ì igrave
Euml í iacute
ª ordf Igrave î icirc
laquo Iacute ï iuml
Icirc ð eth
  • Iuml ñ ntilde ò ograve macr Ntilde ó oacute Ograve ô ocirc plusmn Oacute õ otilde Ocirc ö ouml Otilde Ouml ø oslash μ ù ugrave Oslash ú uacute middot Ugrave û ucirc cedil Uacute ü uuml Ucirc ý yacute º ordm Uuml þ raquo Yacute ÿ yuml
CHR_TO_STRING forms a ASCII characters from a byte and returns it as a
one-character string.

13.9. CLEAN

Type Function : STRING
Input IN: STRING (input)
CX: STRING (All characters are not to be deleted)
Output STRING (result STRING)
CLEAN removes all characters from a string that are not included in the
string CX.
CLEAN('Nr.1 23#', '0123456789 ') = '123'

13.10. CODE

Type Function : BYTE
Input STR: STRING (string)
INT: POS (position at which the character is read)
Output BYTE (code of the character at position POS)
CODE determines the numerical code for a character at the position POS
in STR. Is CODE called with a position with less than 1 or greater than the
length of STR, 0 is returned.
Example: CODE('ABC 123',4) = 32 (The character '' is encoded with the
value of 32).

13.11. COUNT_CHAR

Type Function : STRING
Input STR: STRING (string)
CHR: Byte (search characters)
Output STRING (result STRING)
COUNT_CHAR determines how often the sign of CHR in the string STR oc-
curs. To search for special characters and control characters, the search
character CHR is specifed as BYTE.

13.12. DEC_TO_BYTE

Type Function: BYTE
Input DEC: STRING(10) (decimal-encoded string)
Output BYTE (output value)
The function DEC_TO_BYTE converts a decimal encoded string into a byte
value. Here only decimal characters '0 ' '9' are interpreted, others in DEC
occurring characters are ignored.
Example: DEC_TO_BYTE('34 ') is 34.

13.13. DEC_TO_DWORD

Type Function: DWORD
Input DEC: STRING(20) (decimal-encoded string)
Output DWORD (output value)
The function DEC_TO_DWORD converts a decimal encoded string into a
byte value. Here only decimal characters '0 ' '9' are interpreted, others in
DEC occurring characters are ignored.
Example: DEC_TO_DWORD('34 ') is 34.

13.14. DEC_TO_INT

Type Function: INT
Input DEC: STRING(10) (decimal-encoded string)
Output INT (output value)
The function DEC_TO_INT converts a decimal encoded string into a byte
value. Here only decimal characters '0 ' '9' and '-' are interpreted, others
in DEC occurring characters are ignored.
Example: DEC_TO_INT ('-34') is -34.

13.15. DEL_CHARS

Type Function : STRING
Input IN: STRING (input)
CX: STRING (All characters which are to be deleted)
Output STRING (result STRING)
DEL_CHARS deletes all characters from a string which are contained in the
string CX.
CLEAN('Nr.1 23#', ' #ABCDEFG') = 'Nr.123'

13.16. DT_TO_STRF

Type Function : STRING
Input DTI: DT (Date and time input value)
MS: INT (ms input)
FMT: STRING (default format for output)
LANG: INT (default language)
Output STRING (result string )
DT_TO_STRF converts a DATETIME value into a formated string. At the in-
put DTI the convertible DATETIME value appears and with the string FMT
the appropriate output format is determined. The input LANG determines
the language to be used (0 = LANGUAGE_DEFAULT, 1 = English and 2 =
German). The language settings are made in the relevant paragraph of
the global constants and can be adapted or modifed. In addition to the
date and time at the input of MS also milliseconds can be processed.
The generated string matches the string FMT where in the string all cha-
racters '#' followed by a capital letter are replaced with the corresponding
value. The following table defnes the format characters:
#A 4 digit year number (2008)
#B 2-digit year number, eg (08)
#C Month 1-2 digits (1,12)
#D Month 2 digits (1, 12)
#E Month 3 letters (Jan)
#F Months written out (January)
#G Day 1 or 2 digits (1, 31)
#H Day 2-digit (01, 31)
#I Week as a number (1 = Monday, 7 = Sunday)
#J Week 2 letters (Mo)
#K Week written out (Monday)
#L AM or PM in American date formats
#M Hour in 24 hour format 1-2 digits (0, 23)
#N Hour in 24 hour format 2 digits (00, 23)
#O Hours in 12 hours Format 1 - 2 digits (1, 12)
# P Hour in 12 hour format 2 digits (01, 12)
#Q Minutes 1-2 digits (0, 59)
#R Minutes 2 digits (00, 59)
#S Seconds 1-2 digits (0, 59)
#T Seconds 2 digits (00, 59)
#U Milliseconds 1-3 digits (0, 999)
#V Milliseconds 3 digits (000, 999)
#W Day 2 digits but pre-padded with blank (' a'  '31 ')
#X Month 2 digits but pre- padded with blank (' 1'  '12 ')
Examples:
DT_TO_STRF(DT#2008-1-1, 'Datum '#C. #F #A', 2) = '1. Januar 2008'
DT_TO_STRF(DT#2008-1-1-13:43:12, '#J #M:#Q am #C. #E #A', 2) =
'Di 13:43 am 1. Jan 2008'

13.17. DWORD_TO_STRB

Type Function : STRING
Input IN: DWORD (input value)
Output STRING(32) (result STRING)
DWORD_TO_STRB converts a DWORD, Word or byte in a STRING of fxed
length. The output string is exactly 32 characters long and is the bitwise
notation of the value of IN. The output string consists of the characters '0
'and '1'. The least signifcant bit is left in the string. DWORD_TO_STRB can
handle input formats, Byte, Word and DWORD types. The output is inde-
pendent of the input type is always a STRING of 32 characters. If a shorter
string is needed, it can be cut with the standard function RIGHT() accor-
dingly. The call RIGHT(DWORD_TO_STRB(X),8) results to a string of 8 cha-
racters to the contents of the lower bytes of X.
Example :
DWORD_TO_STRB(127) = '00000000000000000000000001111111'

13.18. DWORD_TO_STRF

Type Function: STRING
Input IN: DWORD (input value)
N: Int (length of the result string)
Output STRING (result STRING)
DWORD_TO_STRF converts a DWORD, Word or byte in a STRING of fxed
length. The output string is exactly N digits, with leading zeros inserted or
leading digits truncated. The maximum permitted length N is 20 digits.
Example: DWORD_TO_STRF(5123, 6) = '005123'
DWORD_TO_STRF(5123, 3) = '123'

13.19. DWORD_TO_STRH

Type Function : STRING
Input IN: DWORD (input value)
Output STRING(8) (result string )
DWORD_TO_STRH converts a DWORD, Word or byte in a STRING of fxed
length. The output string is exactly 8 characters long and is the hexadeci-
mal notation of the value of IN. The output string consists of the charac-
ters '0 ' '1' and 'A ' 'F'. The least signifcant hexadecimal character is
right in the string. DWORD_TO_STRH can process input as byte, word and
DWORD types. The output is independent of the input type is always a
STRING of 32 characters. If a shorter string is needed, it can be cut with
the standard function RIGHT() accordingly. The call
RIGHT(DWORD_TO_STRH(X),4) results to a string of 4 characters to the
contents of the lower 2 bytes of X.
Example: DWORD_TO_STRH(127) = '0000007F'

13.20. EXEC

Type Function: STRING
Input STR : STRING (input STRING)
Output STRING (result STRING)
The function EXEC calculates mathematic expressions and results a string.
The expression can only be a simple expression with an operator and wi-
thout brackets. For errors, such as a divide by zero EXEC provides the re-
turn string 'ERROR'.
The valid operators are: +, - *, /, ^, SIN, COS, TAN, SQRT.
REAL as numbers and integer numbers are allowed.
Example: EXEC('3^2') = '9'
EXEC('4-2') = '2'

13.21. FILL

Type Function: STRING
Input C : BYTE (Character Code)
L: INT (length of string)
Output STRING (result STRING)
FILL creates a string consisting of the symbol C with the length L.
FILL(49,5) = '11111'
The FILL function evaluates the Global Setup constant STRING_LENGTH
and limits the maximum length L of the string to STRING_LENGTH.

13.22. FIND_CHAR

Type Function: INT
Input STR : STRING (input STRING)
POS : INT (start position)
Output INT (pos of frst character that is not a control character)
FIND_CHAR searches the string STR starting at position POS and returns
the position at which the frst character is not a control character. Control
characters are all characters whose value is less than 32 or 127. In exami-
ning the Global Setup EXTENDED_ASCII constant is considered. If EXTEN-
DED_ASCII = TRUE the extended ASCII character-set to be considered in
accordance with ISO 8859-1. Umlauts like Ä, Ö, Ü are considered only if
the global constant EXTENDED_ASCII = TRUE. If EXTENDED_ASCII = FAL-
SE characters of the extended character set with a value > 127 interpre-
ted as control characters.

13.23. FIND_CTRL

Type Function: INT
Input STR : STRING (input STRING)
POS : INT (start position)
Output INT (the frst character is a control character)
FIND_CTRL searches the string str starting at position POS and returns the
position at which the next control character is. Control characters are all
characters whose value is less than 32 or 127.

13.24. FIND_NONUM

Type Function: INT
Input STR: STRING (String input)
POS: INT (position at which the search begins)
Output INT (The frst character that is not a number or point)
The function FIND_NONUM searches STR from the starting position POS
from left to right and returns the frst position which is not a number.
Numbers are the letters "09" and "."
Example: FIND_NONUM('4+33',1) = 2

13.25. FIND_NUM

Type Function: INT
Input STR: STRING (String input)
POS: INT (position at which the search begins)
Output INT (position of frst character that is a number or point)
The function searches FIND_NUM STR from position POS from left to right
and returns the frst position that is a number.
Numbers are the letters "09" and "."
Example: FIND_NONUM('4+33',1) = 1

13.26. FINDB

Type Function: INT
Input STR1: STRING (String input)
STR1: STRING (String input)
Output INT (position of last occurrence of STR2 in STR1)
The function FINDB searched for the presence of STR2 in STR1 and returns
the last position of STR2 in STR1.
If STR2 is not found, a 0 is returned.
Example: FINDB('abs12fr12bus12', '12') = 14

13.27. FINDB_NONUM

Type Function: INT
Input STR: STRING (String input)
Output INT (position of the last letter that is not a number)
The function FINDB_NONUM STR searches from right to left and returns
the last position which is not a number.
Numbers are the letters "09" and "."
Example: FINDB_NONUM('4+33+1') = 5

13.28. FINDB_NUM

Type Function: INT
Input STR: STRING (String input)
Output INT (of the last character, which is a number or point)
The function FINDB_NUM searches STR from right to left and returns the
last position that is a number.
Numbers are the letters "09" and "."
Example: FINDB_NUM('4+33+1hh') = 6

13.29. FINDP

Type Function: INT
Input STR: STRING (String input)
SRC: STRING (search string)
POS: INT (from the position being sought)
Output INT (position of the frst letter of the found string)
FINDP searches in a string STR starting at position POS for a string SRC. If
SRC found in the string so the position of the frst character of SRC in STR
is returned. If the string starting at position POS is not found, an 0 is retur-
ned. If an empty string is specifed as the search string, the module deli-
vers the result 0.
Example: FINDP('ein Fuchs ist ein Tier','ein',1) = 1;
FINDP('ein Fuchs ist ein Tier','ein',2) = 15;
FINDP('ein Fuchs ist ein Tier','ein',16) = 0;

13.30. FIX

Type Function: STRING
Input STR: STRING (String input)
L: INT (fxed-length od output string)
C: BYTE (padding character when padding)
M: INT (mode for padding)
Output STRING (string of fxed length N)
FIX creates a string of fxed length N. The string STR at the input is trunca-
ted to the length N respective flled with the fll character C. If the string
STR is shorter than the length L to be created, will the string be flled de-
pending on M, with the fll character C. If M = 0, the padding at the end of
the string is appended, if M = 1, the padding is attached the beginning
and when M = 2, the string is centered between fll character. If the num-
ber of the necessary padding is odd and if M = 2, the fll at the end has a
fll character more than at the beginning. The FIX function evaluates the
Global Setup string_length constant and limits the maximum length L of
the string to string_length.

13.31. FLOAT_TO_REAL

Type Function: REAL
Input FLT: STRING(20) (foating point)
Output REAL (REAL value of the foating point)
FLOAT_TO_REAL converts a string- foating point number into a data type
REAL. While the conversion characters "." or ',' interpreted as a comma
and 'E' or 'e' as the separator of the exponent. The characters '-
0123456789' are evaluated and others in FLT occurring characters are
ignored.

13.32. FSTRING_TO_BYTE

Type Function: BYTE
Input IN: STRING(12) (String input)
Output BYTE (Byte value)
FSTRING_TO_BYTE converts a formatted string into a byte value. It sup-
ports following input formats:
2#0101 (binary), 8#345 (octal), 16#2a33 (hexadecimal) and 234 (deci-
mal).

13.33. FSTRING_TO_DT

Type Position: DT
Input SDT: STRING(60) (String input)
FMT: STRING(60) (formatting)
Output DT (identifed date and time)
FSTRING_TO_DT convert a formatted string to a DATETIME value. Useing
the string FMT a format is given for decoding. The character '#' followed
by a letter defnes the information to be decoded.
#Y Year in the spelling in 08 or 2008
#M Month in the spelling of 01 or 1
#N Month in the spelling of 'Jan' or 'January' (Big and small letters are ignored)
#D Day in the spelling of 01 or 1
#h Hour in the spelling of 01 or 1
#m Minute in the spelling of 01 or 1
#s Second in the spelling of 01 or 1
Examples:
FSTRING_TO_DT('25. September 2008 at 10:01:00', '#D. #N #Y **
#h:#m:#s')
FSTRING_TO_DT('13:14', '#h:#m')

13.34. FSTRING_TO_DWORD

Type Function: DWORD
Input IN: STRING(40) (String input)
Output DWORD (32bit value)
FSTRING_TO_DWORD converts a formatted string to a 32bit Value. It sup-
ports following input formats:
2#0101 (binary), 8#345 (octal), 16#2a33 (hexadecimal) and 234 (deci-
mal).

13.35. FSTRING_TO_MONTH

Type Function: INT
Input MTH: STRING(20) (String input)
LANG: INT (language)
Output INT (month number 112)
FSTRING_TO_MONTH determines from a string containing a month name
or abbreviation the value of the month. The function can handle both the
month names and abbreviations as input as well as a number of the
month.
FSTRING_TO_MONTH('Januar',2) = 1
FSTRING_TO_MONTH('Jan',2) = 1
FSTRING_TO_MONTH('11',0) = 11
The input LANG selects the used language, 0 = the default in the Setup , 1
= English  more info about the language settings, see the chapter Data
Types.

13.36. FSTRING_TO_WEEK

Type Function: BYTE
Input WEEK: STRING(60) (String input)
LANG: INT (language)
Output BYTE (Bitpattern of week days)
FSTRING_TO_WEEK decode a list of days on the form 'MO,TU,3'in a Bitpat-
tern (bit6 = MO.Bit0 = So) For the evaluation each of the frst two letters
of the list elements are evaluated, the rest are ignored. If the string con-
tains spaces they will be removed. The days of the week can be present in
both upper-or lowercase. LANG specifes the language used, 1 = English, 2
= German, 0 is the default language defned in the setup.
Mo = 1; Di, Tu = 2; We, Mi = 3; Th, Do = 4; Fr = 5; Sa = 6; So, Su = 7
Since the function evaluates only the frst two characters, the weekdays
may also be spelled out (Monday) format.
As an alternative form, the weekday can be specifed as number 17.
The list includes the weekdays unsorted and separated by commas.
FSTRING_TO_WEEK ('Mo,Tu,Sa',2) = 2#01100010.

13.37. FSTRING_TO_WEEKDAY

Type Function: INT
Input WDAY: STRING(20) (String input)
LANG: INT (language)
Output INT (weekday)
FSTRING_TO_WEEKDAY decodes a weekday in the form 'MO' to an integer,
1 = MO . 7 = Sun. For the analysis the frst two letters of the string WDAY
are evaluated, all others are ignored. If the string contains spaces they will
be removed. The days of the week can be present in both upper-or lower-
case. Since the function evaluates only the frst two characters, the week-
days may also be spelled out (Monday) format.
Mo = 1; Di, Tu = 2; We, Mi = 3; Th, Do = 4; Fr = 5; Sa = 6; So, Su = 7
As an alternative form, the weekday can be specifed as number 17.
LANG specifes the used language, 1 = English, 2 = German, 0 = defned
default language in the Setup.

13.38. HEX_TO_BYTE

Type Function: BYTE
Input HEX: STRING(5) (hex string)
Output BYTE (output value)
The function converts a hexadecimal string HEX_TO_BYTE in a BYTE value.
Here only hexadecimal characters '0''9', 'af' and 'A' 'F' are interpreted,
others occurring in HEX characters are ignored.
Example: HEX_TO_BYTE('FF') is 255.

13.39. HEX_TO_DWORD

Type Function: DWORD
Input HEX: STRING(20) (hex string)
Output DWORD (output value)
The function HEX_TO_DWORD converts a hexadecimal string in a DWORD
value. Here only hexadecimal characters '0''9', 'af' and 'A' 'F' are inter-
preted, others occurring in HEX characters are ignored.
Example: HEX_TO_DWORD('FF') is 255.

13.40. IS_ALNUM

Type Function: BOOL
Input STR: STRING (String input)
Output BOOL (TRUE if STR contains only letters or numbers)
IS_ALNUM test if in the string STR are only letters or numbers. If an incor-
rect, non-alphanumeric character is found the function returns FALSE. STR
contains only letters or numbers, the result is TRUE. Letters are the cha-
racters AZ and aZ, and numbers are the signs 09. In examining the
Global Setup constant EXTENDED_ASCII is considered. If EXTENDED_ASCII
= TRUE the extended ASCII character-set to be considered in accordance
with ISO 8859-1. Umlauts like Ä, Ö, Ü are considered only if the global con-
stant EXTENDED_ASCII = TRUE.

13.41. IS_ALPHA

Type Function: BOOL
Input STR: STRING (String input)
Output BOOL (TRUE if STR contains only letters)

IS_ALPHA tests whether the string STR contains only letters. If an incorrect, non-alphanumeric character is found the function returns FALSE. If only letters are included in STR is the result of TRUE. Letters are the characters AZ and az. In examining the Global Setup EXTENDED_ASCII constant is considered. If EXTENDED_ASCII = TRUE the extended ASCII character-set to be considered in accordance with ISO 8859-1. Umlauts like Ä, Ö, Ü are considered only if the glo- bal constant EXTENDED_ASCII = TRUE.

13.42. IS_CC

Type Function: BOOL
Input STR: STRING (String input)
CMP: STRING (comparison characters)
Output BOOL (TRUE if STR contains only those listed in the STRING
CMP
contains)
IS_CC tests whether the string in STR only the in STR listed characters are
included. If another character is found the function returns FALSE.
Examples:
IS_CC('3.14', '0123456789.') = TRUE
IS_CC('-3.14', '0123456789.') = FALSE

13.43. IS_CTRL

Type Function: BOOL
Input STR: STRING (String input)
Output BOOL (TRUE if STR contains only control characters)
IS_CTRL tests whether the string STR are only control characters included.
If another character is found the function returns FALSE. If in STR are only
control characters included, the function returns TRUE. Control characters
are the characters with the decimal 031 and 127

13.44. IS_HEX

Type Function: BOOL
Input STR: STRING (String input)
Output BOOL (TRUE if STR contains only hexadecimal)
IS_HEX tests whether the string STR contains only hexadecimal characters
are. If another character is found the function returns FALSE. If in STR are
only hexadecimal characters included, the function returns TRUE. The he-
xadecimal character are characters with the decimal code 09, af. and
AF.

13.45. IS_LOWER

Type Function: BOOL
Input STR: STRING (String input)
Output BOOL (TRUE if str contains only lowercase letters)
IS_LOWER tests whether the string STR only lowercase letters are inclu-
ded. If anything other than a small letter found the function returns FALSE.
If in STR are only lowercase letters included, the function returns TRUE. In
examining the Global Setup EXTENDED_ASCII constant is considered. If
EXTENDED_ASCII = TRUE the extended ASCII character-set to be conside-
red in accordance with ISO 8859-1. Umlauts like Ä, Ö, Ü are considered
only if the global constant EXTENDED_ASCII = TRUE.

13.46. IS_NCC

Type Function: BOOL
Input STR: STRING (String input)
CMP: STRING (comparison characters)
Output BOOL (TRUE if STR none of the character listed in the STRING
CMP
contains)
IS_NCC tests whether the string STR none of the in STR listed characters
are included. Is a character of CMP found in STR, the function returns FAL-
SE.
Examples:
IS_NCC('3.14', ',-+()') = TRUE
IS_NCC('-3.14', ',-+()') = FALSE

13.47. IS_NUM

Type Function: BOOL
Input STR: STRING (String input)
Output BOOL (TRUE if STR does not contain capital letters)
IS_NUM tests whether the string STR contains only numbers. If another
character is found the function returns FALSE. If in STR are only numbers
included, the function returns TRUE. Numbers are the character 09.

13.48. IS_UPPER

Type Function: BOOL
Input STR: STRING (String input)
Output BOOL (TRUE if STR contains only capital letters)
IS_UPPER checks if in the string STR all capital letters are included. If an
incorrect, non capital character is found the function returns FALSE. If in
STR are only capital letters included, the function returns TRUE. In exami-
ning the Global Setup EXTENDED_ASCII constant is considered. If EXTEN-
DED_ASCII = TRUE the extended ASCII character-set to be considered in
accordance with ISO 8859-1. Umlauts like Ä, Ö, Ü are considered only if
the global constant EXTENDED_ASCII = TRUE.

13.49. ISC_ALPHA

Type Function: BOOL
Input IN: BYTE (characters)
Output BOOL (TRUE IN a sign of az, AZ or Umlaut ) is
ISC_ALPHA tests whether the character IN is an alphabetic character. If IN
is a sign AZ, az or any umlaut, the function returns TRUE, if not the
function returns FALSE. In examining the Global Setup EXTENDED_ASCII
constant is considered. If EXTENDED_ASCII = TRUE the extended ASCII
character-set to be considered in accordance with ISO 8859-1. Umlauts
like Ä, Ö, Ü are considered only if the global constant EXTENDED_ASCII =
TRUE.
The following Table Explains the code:
Code EXTENDED_ASCII = TRUE EXTENDED_ASCII = FAS-
064 FALSE LEFALSE
6590 TRUE TRUE
9196 FALSE FALSE
97122 TRUE TRUE
123191 FALSE FALSE
192214 TRUE FALSE
215 FALSE FALSE
216246 TRUE FALSE
247 FALSE FALSE
248255 TRUE FALSE

13.50. ISC_CTRL

Type Function: BOOL
Input IN: BYTE (characters)
Output BOOL (TRUE IN a sign is 09)
ISC_CTRL tests whether a sign IN is a control character, if IN is a controll
character, the function returns TRUE, if not the function returns FALSE.
Control characters are all characters with code < 32 or 127.

13.51. ISC_HEX

Type Function: BOOL
Input IN: BYTE (characters)
Output BOOL (TRUE IN a sign is 09)
ISC_HEX tests whether a sign IN is a hex character, If IN is a sign 09, AF,
af the function returns TRUE if the function returns FALSE.
The signs are 09 are the codes (4857)
The characters AF are the codes (6570)
The characters af are the codes (97102)

13.52. ISC_LOWER

Type Function: BOOL
Input IN: BYTE (characters)
Output Type
ISC_LOWER tests whether a sign IN is a lowercase letter, If IN is a lower
case the function returns TRUE, else the function returns FALSE. In exami-
ning the Global Setup EXTENDED_ASCII constant is considered. If EXTEN-
DED_ASCII = TRUE the extended ASCII character-set to be considered in
accordance with ISO 8859-1.
The following Table discusses the character codes:
Code EXTENDED_ASCII = TRUE EXTENDED_ASCII = FASLE
096, 123223, 247, 255 FALSE FALSE
97122 TRUE TRUE
224246 TRUE FALSE
248254 TRUE FALSE

13.53. ISC_NUM

Type Function: BOOL
Input IN: BYTE (characters)
Output Type
ISC_NUM tests whether a sign IN is a number, if IN is a character 09, the
function returns TRUE, if not the function returns FALSE. The character 09
are codes (4857)

13.54. ISC_UPPER

Type Function: BOOL
Input IN: BYTE (characters)
Output Type
ISC_UPPER tests whether a sign IN is a captial letter, if IN is a capital let-
ter, the function returns TRUE, if not the function returns FALSE. In exami-
ning the Global Setup EXTENDED_ASCII constant is considered. If EXTEN-
DED_ASCII = TRUE the extended ASCII character-set to be considered in
accordance with ISO 8859-1.
The The following table describes the character codes:
Code EXTENDED_ASCII=TRUE EXTENDED_ASCII = FASLE
064,91191,215, 223255 FALSE FALSE
6590 TRUE TRUE
192214 TRUE FALSE
216222 TRUE FALSE

13.55. LOWERCASE

Type Function: STRING
Input STR: STRING (String input)
Output STRING (STRING in lowercase)
The function LOWERCASE converts the String STR to lower case. During
conversion, the Global Setup EXTENDED_ASCII constant is considered. If
EXTENDED_ASCII = TRUE extended ASCII character set are evaluated ac-
cording to ISO 8859-1. Umlauts like Ä, Ö, Ü are considered only if the glo-
bal constant EXTENDED_ASCII = TRUE. A detailed description of the code
change is found in the function TO_LOWER.

13.56. MESSAGE_4R

Type Function module
Input M0 :. M3 STRING(string_length) (Information)
MM: INT (message appears maximum)
ENQ: BOOL (enable input)
CLK: BOOL (input to the next turn)
T1: TIME (time for automatic advance)
Output MX: STRING(string_length) (output string)
MN: INT (currently active message)
TR: BOOL ( Trigger Output)
MESSAGE_4R provides at the output MX up to 4 messages. There is only
one available of up to 4 entries at MX. The number of messages can be li-
mited to the input of MM. MM is set to 2 then only the messages M0 M2
passed to output after each other. MM is not set then all messages will be
issued M0M3. With each rising edge of CLK, the next message is written
to MX, if CLK remains at TRUE so after the time T1 the next message is
passed automatically, until CLK is FALSE again. If the enable-input ENQ is
set to FALSE, at the output MX '' is passed and the module has no functi-
on. The output MN indicates what message is just passed at the output
MX. The output TR is always for one cycle TRUE if the message at the out-
put MX has changed, it serves to control given modules to process the
messages.

13.57. MESSAGE_8

Type Function module
Input IN1IN8: BOOL (select inputs)
Setup S1S8: STRING(default message)
Output M: STRING (String output)
MESSAGE_8 generates an output of 8 messages on M. If none of the inputs
IN1IN8 are TRUE,the output to M is an empty string, otherwise one of the
stored in S1S8 messages is passed. The module passes the message
with the highest priority. IN1 has the highest priority and IN8 the lowest.
MESSAGE_8 can be used in conjunction with the module STORE_8 to save
and view events.
In the following example, up to 8 fault events (E0E7)
are stored, and in each case the highest priority message is shown at the
output of M MESSAGE_8. With the CLEAR input last message can be dele-
ted by triggering and the next pending message is passed. WITH the RE-
SET input all pending error messages can be cleared.

13.58. MIRROR

Type Function: STRING
Input STR: STRING (String input)
Output STRING (input string read backwards)
MIRROR reads the string STR reverse and passes the characters in reverse
order.
Example: MIRROR ('This is a test') = 'tset a si siht'

13.59. MONTH_TO_STRING

Type Function: STRING (10)
Input MTH: INT (Month 112)
LANG: INT (Language 0 = Default )
LX: INT (length of string)
Output STRING (10) (output value)
MONTH_TO_STRING convert a month number to its equivalent string. The
input MTH passes the month: 1 =January, 12 = December. The input LANG
chooses the language: 1 = English and 2 = German. LANG = 0 used as
Default the language specifed in the Global Setup variable
LANGUAGE_DEFAULT. The input LX sets the length of the string to be gene-
rated: 0 = full month name, 3 = 3-letter abbreviation, all other values at
the input LX are undefned.
The strings produced by the module, and the supported languages are de-
fned in the Global Constants and can be expanded and changed.
MONTH_TO_STRING(1,0,0) = 'January'
dependent on the global constant LANGUAGE_DEFAULT
MONTH_TO_STRING(1,2,0) = 'Januar'
MONTH_TO_STRING(1,2,3) = 'Jan'

13.60. OCT_TO_BYTE

Type Function: BYTE
Input OCT: STRING (10) (Octal string)
Output BYTE (output value)
The function OCT_TO_BYTE converts an octal encoded string into a byte
value. Only the octal characters are '0 ''7' are interpreted, others in HEX
occurring characters are ignored.
Example: OCT_TO_BYTE('11') results 9.

13.61. OCT_TO_DWORD

Type Function: DWORD
Input OCT : STRING(20) (Oktale Zeichenkette)
Output DWORD (output value)
The function OCT_TO_DWORD converts an octal encoded string into a byte
value. Only the octal characters are '0 ''7' are interpreted, others in HEX
occurring characters are ignored.
Example: OCT_TO_DWORD ('11 ') result 9.

13.62. REAL_TO_STRF

Type Function: STRING(20)
Input IN: REAL (input value)
N: INT (number of decimal places)
D : STRING(1) (decimal punctuation character)
Output STRING (String output)
REAL_TO_STRF converts a REAL value to a string with a fxed number of
decimal N. At the conversion entirely in a normal number format XXX.NNN
is converted. At the conversion IN is rounded to N digits after the decimal
point and then converted into a String to the format XXX.NNN. When N =
0, the REAL number is rounded to 0 digits after the decimal point and the
result is passed as an integer without a point and decimal places. If the
number IN is less than, as with N decimal places can be captured, a zero is
passed. The decimal places are always flled up to N digits with zeros. The
maximum string length is 20 digits. The D input determines which charac-
ter represents the decimal point.
Examples:
REAL_TO_STRF(3.14159,4,'.') = '3.1416'
REAL_TO_STRF(3.14159,0,'.') = '3'
REAL_TO_STRF(0.04159,3,'.') = '0.042'
REAL_TO_STRF(0.001,2',') = '0,00'

13.63. REPLACE_ALL

Type Function: STRING
Input STR: STRING (String input)
SRC: STRING (search string)
REP: STRING (String replacement)
Output STRING (String output)
REPLACE_ALL replaces all occurring strings SRC in the string STR with REP.
An empty string SRC gives no results.
Example: REPLACE_ALL('123BB456BB789BB','BB','/') = '123/456/789/'
REPLACE_ALL('123BB456BB789BB','BB','') = '123456789'

13.64. REPLACE_CHARS

Type Function: STRING
Input STR: STRING (String input)
SRC: STRING (search strings)
REP: STRING (surrogate)
Output STRING (String output)
REPLACE_CHARS replaces all the characters STR in String SRC with the
characters at the same place in REP.
example: REPLACE_CHARS('abc123', '0123456789', ABCDEFGHIJ') = 'ab-
cABC'

13.65. REPLACE_UML

Type Function: STRING
Input STR: STRING (String input)
Output STRING (String output)
REPLACE_UML replaces umlauts with a combination of two characters so
that the result contains no more umlauts. The large and small letters are
considered here. If a word is all upper case and is an umlaut is mentioned,
this is replaced by a capital letter followed by a lowercase letter, in the
case of a ß which has no capitals there will always be replaced with two
small letters. If the function REPLACE_UML is used on a uppercase word,
then it must be ensured using the function UPPERCASE() that all capital
letters that the lower case are again converted to uppercase.
Ä > Ae, Ö > Oe, Ü > Ue, ä > ae, ö > oe, ü > oe, ß > ss.

13.66. TICKER

Type Function module
Input N: INT (length of the display Strings )
PT: TIME (slide delay, Default = T#1s)
I / O TEXT: STRING (String input)
Output DISPLAY: STRING (String output)
TICKER generate at the output DISPLAY a running script. At the output DIS-
PLAY a substring of text with the length N is output. DISPLAY is passed to
output in a time frame of PT and starts at each pass from one place to the
left of the input string TEXT. The scrolling text is generated only when N <
than the length of TEXT. If N >= length of text then the String TEXT is di-
rectly represented at the output of DISPLAY.

13.67. TO_LOWER

Type Function: BYTE
Input IN: BYTE ( Characters to be converted )
Output BYTE (converted characters)
To_lower converts individual characters to lowercase. During conversion,
the Global Setup EXTENDED_ASCII constant is considered. If
EXTENDED_ASCII = TRUE, all characters of the extended ASCII character
set to be considered in accordance with ISO 8859-1.
The following Table discusses the conversion code:
Code EXTENDED_ASCII = TRUE EXTENDED_ASCII = FALSE
064 064 064
6590 97122 97122
91191 91191 91191
192214 224246 192214
215 215 215
216222 248254 216254
223255 223255 223255

13.68. TO_UML

Type Function: STRING(2)
Input IN: BYTE ( Characters to be converted )
Output STRING (2) (converted characters)
TO_UML converts individual characters of the character set to greater than
127 in a combination of two letters. It is here the extended ASCII character
set ISO 8859-1 (Latin1).
It will be converted the following characters:
Ä >> Ae ä >> ae Ö >> Oe ö >> oe Ü >> Ue ü >> ue
ß >> ss
All other characters are returned as a string with the character IN.

13.69. TO_UPPER

Type Function: BYTE
Input IN: BYTE ( Characters to be converted )
Output BYTE (converted characters)
To_upper converts some characters to uppercase. During conversion, the
Global Setup EXTENDED_ASCII constant is considered. If EXTENDED_ASCII
= TRUE, all characters of the extended ASCII character set to be conside-
red in accordance with ISO 8859-1.
The following Table discusses the conversion code:
Code EXTENDED_ASCII = TRUE EXTENDED_ASCII = FALSE
064 064 064
6590 97122 97122
91191 91191 91191
192214 224246 192214
215 215 215
216222 248254 216254
223255 223255 223255

13.70. TRIM

Type Function: STRING
Input STR: STRING (String input)
Output STRING (STR without spaces)
The TRIM function removes all spaces from STR.
Example: TRIM('fnd BX12') = 'fndBX12'

13.71. TRIM1

Type Function: STRING
Input STR: STRING (String input)
Output STRING (STR without double spaces)
The function TRIM1 replaces multiple spaces with one space. Spaces at
the beginning and the end of STR will be deleted completely.
Example: TRIM1(' fnd BX12 ') = 'fnd BX12'

13.72. TRIME

Type Function: STRING
Input STR: STRING (String input)
Output STRING (output string)
The TRIME function removes spaces at the beginning and the end of STR.
Spaces within the string are ignored, even if they occur repeatedly.

13.73. UPPER CASE

Type Function: STRING
Input STR: STRING (String input)
Output STRING (STRING in uppercase)
The function UPPERCASE converts all letters of STR in uppercase. During
conversion, the Global Setup EXTENDED_ASCII constant is considered. If
EXTENDED_ASCII = TRUE, all characters of the extended ASCII character
set to be considered in accordance with ISO 8859-1. Umlauts like Ä, Ö, Ü
are considered only if the global constant EXTENDED_ASCII = TRUE. A de-
tailed description of the code change is found in the function TO_UPPER.
Example: UPPERCASE('fnd BX12') = FIND BX12

13.74. WEEKDAY_TO_STRING

Type Function: STRING (10)
Input WDAY: INT (weekday 17)
LANG: INT (Language 0 = Default )
LX: INT (length of string)
Output STRING (10) (output value)
WEEKDAY_TO_STRING converts a weekday in the corresponding string.
The input WDAY indicates the corresponding day of the week: 1 = Monday
and 7 = Sunday. The input LANG chooses the language: 1 = English and 2
= German. LANG = 0 used as Default the language specifed in the Global
Setup variable LANGUAGE_DEFAULT. [fzy] The input LX sets the length of
the string to be generated: 0 = full month name, 3 = 3-letter abbreviation,
all other values at the input LX are undefned.
The strings produced by the module, and the supported languages are de-
fned in the Global Constants and can be expanded and changed.
WEEKDAY_TO_STRING(1,0,0) = ' Monday '
dependent on the global constant LANGUAGE_DEFAULT
WEEKDAY_TO_STRING(1,2,0) = ' Monday '
WEEKDAY_TO_STRING(1,0,2) = ' Mon '