Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 18 of 20

Gryphon D432/D412Plus Barcode Reader Product Reference Guide: Appendix B

Pages 143 to 146 of 160, from Gryphon D432/D412Plus Barcode Reader Product Reference Guide

The original document is the PDF (3.3 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Datalogic D432

Page 143

Appendix B Programming for Expert Users This document is addressed to expert users who are familiar with software programming languages and want to define a 1personalized code formatting. The provided programming language allows creating either simple or complex formatting expressions by means of the basic functions connected together through the following operators: (, ), -, +. The syntax to be used to transmit the expressions to the Gryphon D432/D412Plus is the following: $+ELB<n>formatting expression<ETX>$where: • • •

<n> is a number in the range 1-5 corresponding to the format to be defined; <ETX> is the conventional character used as terminator of the command; the formatting expression uses ASCII characters when containing text strings. For this reason, the string must be inserted between two quotation marks. The following example shows the ASCII conversion of the "ABC" string: $+ELB1}414243+#DS^C$-.

Product Reference Guide

141

Page 144

Function Description All the functions and conventions to be used within the formatting expressions are listed below: FUNCTION NAME

DESCRIPTION

FSTR

Searches for a defined substring by its starting and ending string.

FLSTR

Searches for a defined substring by its starting string and its length.

SSTR

Extracts a defined substring from the original string.

FPOS

Searches for a position of a defined substring within the original string.

LSTR

Returns a string length.

ISTR

Insert a substring in the original string.

RSTR

Substitutes a defined substring contained in the original string with a new one.

CONVENTIONS

DESCRIPTION

+

Concatenates two strings or fields.

-

Deletes a substring or a field from the original string.

#DS

Returns the string which has been decoded by the library.

#F<n>

Returns the result of a format which has been previously defined. The <n> value is in the range 1-4.

FindStringByStarting&EndingChar (FSTR) This function has the following syntax: FSTR<source_string, string_start, string_stop, mode>string This function searches for a substring having a defined starting character ("string_start") and a defined ending character ("string_stop") within the "source_string". It returns the string you searched for, or an empty one in case of failure. If searching for a substring having characters already known, the "string_start" and "string_stop" arguments must share the same value. The "mode" argument allows managing the starting character ("string_start") and the ending character ("string_stop"):

0 = include both starting and ending character 1 = include only starting character 2 = include only ending character 3 = discard both starting and ending character 142

Gryphon™ D432/D412Plus

Page 145

FindStringByStartingChar&Len (FLSTR) This function has the following syntax: FLSTR<source_string, string_start, len, mode>ðstring This function searches for a substring having a defined starting character ("string_start") and a defined length ("len") within the "source_string". It returns the string you searched for, or an empty one in case of failure. If searching for a substring having a length already known, the "string_start" and "string_stop" arguments must share the same number. The "mode" argument allows managing the starting character ("string_start"):

0 = include starting character 1 = discard starting character SelectString (SSTR) This function has the following syntax: SSTR<source_string, pos_start, pos_end>string It extracts a substring whose characters are between "pos_start" and "pos_end" from the "source_string". If "pos_end" is longer than the "source_string" length, no error will be generated since the exceeding characters are ignored. The first character of every string is in position 1.

FindPosition (FPOS) This function has the following syntax: FPOS<source_string, search_string>position This function searches for a defined substring within the "source_string" and returns its position. If the substring is not found, the returned value is 1.

StringLength (LSTR) This function has the following syntax: LSTR<string>length This function returns the length of the defined string.

StringConcatenation This function has the following syntax: string1 + string2string This function allows concatenating two different strings in order to get a single string as result.

StringDiscard This function has the following syntax: string1 - string2string This function discards all the strings having the same value as "string2" which can be found in "string1". If no "string2" is found within "string1", the result returns "string1".

InsertString (ISTR) This function has the following syntax:

Product Reference Guide

143

Page 146

ISTR<source_string, string1, position>string This function inserts a new string ("string1") within the "source_string" and places it in the defined "position". If the value of the "position" argument is longer than "source_string" length, "string1" will be placed after the last character of the source string.

ReplaceString (RSTR) This function has the following syntax: RSTR<source_string, string1, string2>string This function searches for "string1" within the "source_string". All the strings having the same value as "string1" within the "source_string" will be replaced by "string2". If no "string1" is found in the "source_string", the result returns the "source_string". Examples

The string transmitted is 12345abcdef3790 and corresponds to the #DS function, as defined in the programming language. 1. expression SSTR<#DS,1,5> + SSTR<#DS,11,15> + SSTR<#DS,6,9> result 12345f3790abcd 2. expression FSTR<#DS, }616263~, }616263~, 0> + SSTR<#DS,LSTR<#DS> -3, LSTR<#DS> result abc3790 3. expression FSTR<#DS, 616272, 616261, 0> result null string 4. expression #DS - FSTR<#DS, 616263, 6566, 0> result 123453790 During the format definition the decoded string represented by #DS does not change.

Using Format Output in Format Definition The input used by the above functions to define the code formatting usually corresponds to the decoded code (#DS). Actually, the formatting expression of each function can also format the result (output) produced by a preceding code formatting. The format output is represented as follows: #F<n>, where: <n> = format number in the range 1-4 #F = format output Being Format 5 not included in other format expression, the format number is in the range 1-4. Furthermore, since a format expression operates upon the output of the preceding formats, the expression defining Format 1 will never contain the result of another format. Example

The following expression is used to define Format 3: #DS + FSTR<#F2, 6173, 6263, 0> The expression input consists of the decoded code and the result produced by Format 2 (#F2). The FSTR function searches for a defined substring within the #F2 result; then, it concatenates this substring and the decoded code. The result corresponds to #F3 output.

144

Gryphon™ D432/D412Plus