DIGITAL_OUTPUT (Part 1)

# DIGITAL_OUTPUT

Name:

DIGITAL_OUTPUT

Syntax:

DIGITAL_OUTPUT \<var1\>[,\<var2\>...];

DIGITAL_OUTPUT \<var[size]\>;

DIGITAL_OUTPUT \<var[size[,\<min\>]]\>;

DIGITAL_OUTPUT \<var1\>[,[_SKIP_]][,\<var2\>...];

Description:

Routes a value from the SIMPL+ program to a SIMPL program. If a value different from 0 is placed on a DIGITAL_OUTPUT, the digital signal in the SIMPL program is set high when the control system processes the logic. Refer to the discussion on fixed and variable arrays in [Declarations Overview.]

NOTE:  DIGITAL_OUTPUTs may be jammed with other digital values from a SIMPL program (i.e., from a BUFFER or other jammable digital logic, even other SIMPL+ symbols). When such an output is jammed, the new value is read back into the SIMPL+ symbol and the value of the output is altered.

NOTE: You should use [isSignalDefined] to test whether the output is connected to an actual signal in the SIMPL program before assigning a value to it. If you assign a value and there is no signal, a message is placed in the system error log.

In X-Generation Control Systems, if a new value is assigned to the DIGITAL_OUTPUT from the SIMPL+ program, the value read back from it within the SIMPL+ program will have the original state until the logic is serviced. For example, if a DIGITAL_OUTPUT has a value of 0, and the value 1 is written to it, the value read back will be 0 until the system processes the rest of the logic attached to that SIMPL+ symbol. This is unlike an ANALOG_OUTPUT. If every change of a DIGITAL_OUTPUT is required to be seen by the logic, a PROCESSLOGIC statement is required after the assignment to the DIGITAL_OUTPUT.

In the 2-Series Control Systems, the logic process sees ALL values that are assigned to the DIGITAL_OUTPUT.  No PROCESSLOGIC is required.  As an example, if the following code is used in the 2-Series Control Systems:

    DIGITAL_OUTPUT State1;

    State1=1;

    State1=0;

The logic will end up seeing a short pulse.

For an array of DIGITAL_OUTPUTs, the maximum value of SIZE is 65535. Valid indices are 1 through the specified size.

NOTE: \<min\> is the number of outputs shown at a minimum, in SIMPL the default is 1. The user can expand the minimum up to the full size. Only the last array of a type can have a \<min\>.

NOTE: The [_SKIP_] keyword can be used in DIGITAL_INPUT, DIGITAL_OUTPUT, ANALOG_INPUT, ANALOG_OUTPUT, BUFFER_INPUT, STRING_INPUT and STRING_OUTPUT declarations.

Example:

DIGITAL_OUTPUT State1, State2;

Signifies that two digital signals are to be sent to a SIMPL program from this SIMPL+ program.

NOTE:  For example, if State1 is jammed high via a BUFFER from outside the SIMPL+ program, the value of State1 becomes 1 and should be handled accordingly in the SIMPL+ code.

DIGITAL_OUTPUT state_bits[3];

Signifies that up to three digital signals are to be sent to a SIMPL program from this SIMPL+ program. The names are referenced as state_bits[1] through state_bits[3]. The same jamming rules apply as in the previous example.

DIGITAL_OUTPUT state_bits[3,3];

Same as above except all three are always shown on the symbol.

Version:

X-Generation

SIMPL v1.20.01 and later

SIMPL v1.50.06 and later, support for DIGITAL_OUTPUT arrays

2-Series

Language Constructs & Functions
Declarations
DIGITAL OUTPUT
DIGITAL_OUTPUT


DIGITAL_OUTPUT (Part 2)

SIMPL v2.01.05 and later  [Same support as X Generation SIMPL Winodws v1.50.06, however, DIGITAL_OUTPUTs or DIGITAL_OUTPUT Arrays cannot be passed by reference]

SIMPL v2.03.18 and later, Fixed size arrays and minimum sizes.

  [_SKIP_]: javascript:void(0);
  [Declarations Overview.]: Declarations_Overview.md
  [isSignalDefined]: ../System_Interfacing/IsSignalDefined.md

DIGITAL_OUTPUT Declarations Overview Part isSignalDefined

DIGITAL_OUTPUT state_bits[3,3];

Same as above except all three are always shown on the symbol. Version:

X-Generation

SIMPL v1.20.01 and later

SIMPL v1.50.06 and later, support for DIGITAL_OUTPUT arrays

2-Series


Declarations Overview (Part 1)

# Declarations Overview

Declarations control the name, type, and number of inputs and outputs on a SIMPL+ symbol. The name is shown as a cue on the symbol in SIMPL and is used as the variable name in the body of the SIMPL+ program. When the symbol is drawn in SIMPL, the inputs are shown in the order of DIGITAL_INPUTs, ANALOG_INPUTs, STRING_INPUTs. The outputs are shown in the order of DIGITAL_OUTPUTs, ANALOG_OUTPUTs, STRING_OUTPUTs. When specifying a declaration, several variable names can be put after a declaration or multiple declaration statements may be used.

 For example:

    ANALOG_INPUT val1, val2, val3;

is equivalent to

    ANALOG_INPUT val1, val2;

    ANALOG_INPUT val3;

Allowable I/O List Combinations:

SIMPL+ Version 2.00 and later gives the ability to define arrays in the Input/Output Lists. SIMPL+ version 3.01 and later introduced the ability to declare multiple fixed-size arrays in the input/output lists, and a minimum expanded size to variable-size arrays. The following are the allowable combinations:

- Zero or more DIGITAL_INPUTs

- Zero or more DIGITAL_INPUT arrays, the last is variable-size, the others are fixed-size.

- Zero or more ANALOG_INPUTs, STRING_INPUTs, or BUFFER_INPUTs in any combination.

- Zero or more ANALOG_INPUT, STRING_INPUT, or BUFFER_INPUT array, the last is variable-size, the others are fixed-size.

- Zero or more DIGITAL_OUTPUTs

- Zero or more DIGITAL_OUTPUT array, the last is variable-size, the others are fixed-size.

- Zero or more ANALOG_OUTPUTs, STRING_OUTPUTs in any combination.

- Zero or more ANALOG_OUTPUT or STRING_OUTPUT array, the last is variable-size, the others are fixed-size.

Fixed and Variable Size Arrays

Although SIMPL+ symbols can only handle one variable size DIGITAL_INPUT array, one variable-size DIGITAL_OUTPUT array, one variable-size ANALOG/STRING/BUFFER input array, and one variable size ANALOG/STRING/OUTPUT array, it is convenient to be able to refer to other inputs and outputs with array notation. Therefore, SIMPL+ allows an unlimited number of fixed-size input or output arrays, that are essentially single input or output values but array notation can be used. Every member of these fixed-size arrays is always shown in the symbol. All arrays, except the last one of each kind, are fixed-size arrays. The last one is variable-size, meaning that the symbol initially shows the first array value. The user can press ALT+ to expand the symbol to its maximum number of array inputs or outputs. In addition, a minimum size can be declared in all variable-size arrays, meaning that the minimum number of array members is always shown, not just the first one, and the array can be expanded from there.

NOTE: The minimum array size number must be from 1 to the size of the array. If a minimum array size is specified on any array, but it is the last one within any type, it will be a compile error.

Example:

DIGITAL_INPUT YesVotes[10]

DIGITAL_INPUT NoVotes[10]

DIGITAL_INPUT AbstainVotes[10,5];

Language Constructs & Functions
Declarations
Declarations Overview
Declarations Overview


Declarations Overview (Part 2)

The symbol will show 10 digital inputs labelled: YesVotes[1], YesVotes[2] ...YesVotes[10], followed by 10 more labelled: NoVotes[1], NoVotes[2] ...NoVotes[10], followed by 5 labelled: AbstainVotes[1], AbstainVotes[2] ...AbstainVotes[5]. You can continue to expand the last one up to AbstainVotes[10].

NOTE: SIMPL+ modules have at most two expandable lists of inputs and two expandable lists of outputs. The first expandable input list must contain the digital inputs. The second expandable list must contain the analogs, serials, and buffered inputs. The same goes for the outputs.  Within each list, all of the fixed (non-array ) inputs or outputs come first, followed by at most one array which is expandable.

Predefined Names:

The names "on" and "off" are reserved. Assigning "on" to a variable sets the variable to 1, assigning "off" sets that variable to 0.

The following shows equivalent, given that VALUE is a DIGITAL_OUTPUT:

    VALUE = 1;   and   VALUE = on;

    VALUE = 0;   and   VALUE = off;

The current available declarations are listed below:

[ANALOG_INPUT]

[ANALOG_OUTPUT]

[ASCII]

[BUFFER_INPUT]

[DIGITAL_INPUT]

[DIGITAL_OUTPUT]

[INHERIT]

[INTEGER]

[LONG_INTEGER]

[VOLATILE]

[NONVOLATILE]

[SIGNED_INTEGER]

[SIGNED_LONG_INTEGER]

[STRING]

[STRING_INPUT]

[STRING_OUTPUT]

[STRUCTURES]

[UTF16]

  [ANALOG_INPUT]: ANALOG_INPUT.md
  [ANALOG_OUTPUT]: ANALOG_OUTPUT.md
  [ASCII]: ../Encoding/ASCII.md
  [BUFFER_INPUT]: BUFFER_INPUT.md
  [DIGITAL_INPUT]: DIGITAL_INPUT.md
  [DIGITAL_OUTPUT]: DIGITAL_OUTPUT.md
  [INHERIT]: ../Encoding/Inherit.md
  [INTEGER]: INTEGER.md
  [LONG_INTEGER]: LONG_INTEGER.md
  [VOLATILE]: VOLATILE.md
  [NONVOLATILE]: NONVOLATILE.md
  [SIGNED_INTEGER]: SIGNED_INTEGER.md
  [SIGNED_LONG_INTEGER]: SIGNED_LONG_INTEGER.md
  [STRING]: STRING.md
  [STRING_INPUT]: STRING_INPUT.md
  [STRING_OUTPUT]: STRING_OUTPUT.md
  [STRUCTURES]: STRUCTURES.md
  [UTF16]: ../Encoding/UTF16.md

If a minimum array size is specified on any array, but it is the last one within any type, it will be a compile error. Example:

DIGITAL_INPUT YesVotes[10]

DIGITAL_INPUT NoVotes[10]

DIGITAL_INPUT AbstainVotes[10,5];


DYNAMIC

# DYNAMIC

Name:

DYNAMIC

Syntax:

DYNAMIC [\<string\> | \<integer_array\> | \<string_array\> | \<structure_array\>];

Description:

Compiler directive to allow the size of a declared array to be changed to a new size.  Global and Local Integer, String and Structure arrays can be declared as dynamic.

Argument:

string, integer array, string array, or structure_array

Example:

DYNAMIC STRING MyStr[10], MyStrArr[10][20];

DYNAMIC INTEGER MyInt[10], MyIntArr[10][20];

DYNAMIC tagMyStruct myStructArr[10];

Version:

X-Generation

Not Supported

2-Series

SIMPL 2.10.24 or later

Requires CUZ 4.000 or later

Language Constructs & Functions
Declarations
Dynamic
DYNAMIC


INTEGER

# INTEGER

Name:

INTEGER

Syntax:

    INTEGER \<var1\>[,\<var2\>...];

    INTEGER \<var1\>[size] [,\<var2\>[size]…];

    INTEGER \<var1\>[rows1][columns1] [,\<var2\>[rows2][columns2]…];

Description:

The first form declares an integer value that is local to this SIMPL+ program. INTEGER values are 16-bit quantities and are treated the same as ANALOG_INPUT values.  When used with traditional comparison operators (not the "S" operators, such as S\<, etc) they are treated as being in the range of 0 to 65535.

The second form declares a one-dimensional array of INTEGER values.

The third form declares a two-dimensional array of INTEGER values. A two-dimensional array can be thought of as a table or matrix.

The values for SIZE, ROWS, and COLUMNS may be up to 65534.

An INTEGER array element may be used anywhere an INTEGER is legal. Array elements are referenced by using the name followed by [element] for one-dimensional arrays or [row][column] for two-dimensional arrays. The element number may range from 0 to the element size. For example, if an array is declared as NUM[2], then legal elements are NUM[0], NUM[1], and NUM[2]. The bracket notation is often called an array subscript.

NOTE:  (X-Gen) The values of INTEGERs declared outside of functions are non-volatile. If the system is powered down and up, the variables will take the previous values. If programs are changed and uploaded, the values are not preserved.

NOTE:  (2-Series) INTEGERs can be volatile or non-volatile. The default is defined using the compiler directives #DEFAULT_NONVOLATILE or #DEFAULT_VOLATILE or overridden using the nonvolatile or volatile keywords.

Example:

    INTEGER temp_level;

Specifies one locally declared INTEGER in this SIMPL+ program

    INTEGER CommandBytes[2];

Specifies an array of three INTEGERS that can be referenced under the name CommandBytes. In pictorial form, it appears as:

|                   |                   |                   |
|-------------------|-------------------|-------------------|
| CommandBytes[0] | CommandBytes[1] | CommandBytes[2] |

      INTEGER Matrix[4][3];

Specifies a two-dimensional array of integers five rows deep by four columns wide. In pictorial form, it appears as:

|                  |                  |                  |                  |
|------------------|------------------|------------------|------------------|
| Matrix[0][0] | Matrix[0][1] | Matrix[0][2] | Matrix[0][3] |
| Matrix[1][0] | Matrix[1][1] | Matrix[1][2] | Matrix[1][3] |
| Matrix[2][0] | Matrix[2][1] | Matrix[2][2] | Matrix[2][3] |
| Matrix[3][0] | Matrix[3][1] | Matrix[3][2] | Matrix[3][3] |
| Matrix[4][0] | Matrix[4][1] | Matrix[4][2] | Matrix[4][3] |

NOTE:  The subscripts of an array may be an expression, i.e.:

INTEGER location[5], room;

               room = 2;

               location[room] = 10;

Version:

X Generation:

SIMPL v1.20.01 and later

SIMPL v1.50.06 and later, allow INTEGER declarations inside of functions.

2-Series:

SIMPL v2.01.05 and later

(supports INTEGER declarations globally and inside functions)

Language Constructs & Functions
Declarations
INTEGER


INTEGER_PARAMETER

# INTEGER_PARAMETER

Name:

INTEGER_PARAMETER

Syntax:

    INTEGER_PARAMETER \<var1\>[,\<var2\>...];

    INTEGER_PARAMETER \<var1\>[size] [,\<var2\>[size]…];

Description:

The first form declares an INTEGER_PARAMETER value that is local to this SIMPL+ program.

The second form declares a one dimensional array of INTEGER_PARAMETER values.

The values for SIZE may be up to 65534.

The actual value for the parameter is entered as a parameter to the SIMPL+ module when the SIMPL+ module is used the SIMPL program.  The parameter has a default range of legal values.  Since parameters can be entered in various formats (percentage, hex, decimal, time, etc.), please see [Allowable Ranges for 2 Series Numeric Formats] to find the valid ranges for the various types.

SIMPL+ Parameters may have further programmatic restrictions placed on them, similar to parameter property sheets for SIMPL modules.  The programmer can restrict the range, only allow certain values to be entered, assume default values, restrict types of units entered among others restrictions.  For more information, please see [Parameter Property Blocks]

An INTEGER_PARAMETER array element may be used anywhere an INTEGER is legal, with the caveat that it may not be written to.  Array elements are referenced by using the name followed by [element]. The element number may range from 1 to the element size. For example, if an array is declared as NUM[2], then legal elements are NUM[1], and NUM[2]. The bracket notation is often called an array subscript.

NOTE: The [_SKIP_] keyword can be used in INTEGER_PARAMETER, LONG_INTEGER_PARAMETER, SIGNED_INTEGER_PARAMETER, SIGNED_LONG_INTEGER_PARAMETER and STRING_PARAMETER declarations.

Example:

    INTEGER_PARAMETER temp_level;

Specifies one INTEGER_PARAMETER with the name temp_level in this SIMPL+ program

    INTEGER_PARAMETER CommandBytes[2];

Specifies an array of two INTEGER_PARAMETERS that can be referenced under the name CommandBytes.

NOTE:  The subscripts of an array may be any positive valid integral expression such as the one shown below.

INTEGER_PARAMETER location[5], room;

INTEGER var;

var = 3;

if(room\>0 && room \<= 5)

{

   print("The location is %d\n", location[var]);

}

print("The location is %d\n", location[room]);

Version:

X Generation: Not Supported.

2-Series: SIMPL v2.10.24 or later, CUZ 4.000 or later.

  [Allowable Ranges for 2 Series Numeric Formats]: ../../Allowable_Ranges_for_2_Series_Numeric_Formats.md
  [Parameter Property Blocks]: ../Compiler_Directives/PARAMETER_PROPERTIES.md
  [_SKIP_]: javascript:void(0);

Language Constructs & Functions
Declarations
INTEGER PARAMETER
INTEGER_PARAMETER

Allowable Blocks Formats INTEGER INTEGER_PARAMETER LONG_INTEGER_PARAMETER Numeric Parameter Property Ranges SIGNED_INTEGER_PARAMETER SIGNED_LONG_INTEGER_PARAMETER Series for


LONG_INTEGER

# LONG_INTEGER

Name:

LONG_INTEGER

Syntax:

    LONG_INTEGER \<var1\>[,\<var2\>...];

    LONG_INTEGER \<var1\>[size] [,\<var2\>[size]…];

    LONG_INTEGER \<var1\>[rows1][columns1] [,\<var2\>[rows2][columns2]…];

Description:

The first form declares a long value that is local to this SIMPL+ program. LONG_INTEGER values are 32-bit quantities ranging from 0-4294967295.

The second form declares a one-dimensional array of LONG_INTEGER values.

The third form declares a two-dimensional array of LONG_INTEGER values. A two-dimensional array can be thought of as a table or matrix.

The values for SIZE, ROWS, and COLUMNS may be up to 65534.

A LONG_INTEGER array element may be used anywhere a LONG_INTEGER is legal. Array elements are referenced by using the name followed by [element] for one-dimensional arrays or [row][column] for two-dimensional arrays. The element number may range from 0 to the element size. For example, if an array is declared as NUM[2], then legal elements are NUM[0], NUM[1], and NUM[2]. The bracket notation is often called an array subscript.

NOTE:  (2-Series) LONG_INTEGERs can be volatile or non-volatile. The default is defined using the compiler directives #DEFAULT_NONVOLATILE or #DEFAULT_VOLATILE or overriden using the nonvolatile or volatile keywords.

Example:

    LONG_INTEGER temp_level;

Specifies one locally declared LONG_INTEGER in this SIMPL+ program

   LONG_INTEGER CommandBytes[2];

Specifies an array of three LONG_INTEGERs that can be referenced under the name CommandBytes. In pictorial form, it appears as:

|                   |                   |                   |
|-------------------|-------------------|-------------------|
| CommandBytes[0] | CommandBytes[1] | CommandBytes[2] |

      LONG_INTEGER Matrix[4][3];

Specifies a two-dimensional array of LONG_INTEGERs five rows deep by four columns wide. In pictorial form, it appears as:

|                  |                  |                  |                  |
|------------------|------------------|------------------|------------------|
| Matrix[0][0] | Matrix[0][1] | Matrix[0][2] | Matrix[0][3] |
| Matrix[1][0] | Matrix[1][1] | Matrix[1][2] | Matrix[1][3] |
| Matrix[2][0] | Matrix[2][1] | Matrix[2][2] | Matrix[2][3] |
| Matrix[3][0] | Matrix[3][1] | Matrix[3][2] | Matrix[3][3] |
| Matrix[4][0] | Matrix[4][1] | Matrix[4][2] | Matrix[4][3] |

NOTE:  The subscripts of an array may be an expression, i.e.:

               LONG_INTEGER location[5], room;

               room = 2;

               location[room] = 10;

Version:

X Generation:  Not Supported

2-Series:  SIMPL v2.01.05 and later

Language Constructs & Functions
Declarations
LONG INTEGER
LONG_INTEGER


LONG_INTEGER_PARAMETER

# LONG_INTEGER_PARAMETER

Name:

LONG_INTEGER_PARAMETER

Syntax:

    LONG_INTEGER_PARAMETER \<var1\>[,\<var2\>...];

    LONG_INTEGER_PARAMETER \<var1\>[size] [,\<var2\>[size]…];

Description:

The first form declares a LONG_INTEGER_PARAMETER value that is local to this SIMPL+ program.

The second form declares a one dimensional array of LONG_INTEGER_PARAMETER values.

The values for SIZE may be up to 65534.

The actual value for the parameter is entered as a parameter to the SIMPL+ module when the SIMPL+ module is used the SIMPL program.  The parameter has a default range of legal values.  Since parameters can be entered in various formats (percentage, hex, decimal, time, etc.), please see [Allowable Ranges for 2 Series Numeric Formats] to find the valid ranges for the various types.

SIMPL+ Parameters may have further programmatic restrictions placed on them, similar to parameter property sheets for SIMPL modules.  The programmer can restrict the range, only allow certain values to be entered, assume default values, restrict types of units entered among others restrictions.  For more information, please see [Parameter Property Blocks]

A LONG_INTEGER_PARAMETER array element may be used anywhere a LONG_INTEGER is legal, with the caveat that it may not be written to.  Array elements are referenced by using the name followed by [element]. The element number may range from 1 to the element size. For example, if an array is declared as NUM[2], then legal elements are NUM[1], and NUM[2]. The bracket notation is often called an array subscript.

NOTE: The [_SKIP_] keyword can be used in INTEGER_PARAMETER, LONG_INTEGER_PARAMETER, SIGNED_INTEGER_PARAMETER, SIGNED_LONG_INTEGER_PARAMETER and STRING_PARAMETER declarations.

Example:

    LONG_INTEGER_PARAMETER temp_level;

Specifies one LONG_INTEGER_PARAMETER with the name temp_level in this SIMPL+ program

    LONG_INTEGER_PARAMETER CommandBytes[2];

Specifies an array of two LONG_INTEGER_PARAMETERS that can be referenced under the name CommandBytes.

 NOTE:  The subscripts of an array may be any positive valid integral expression as shown in the example below.

INTEGER_PARAMETER location[5], room;

LONG_INTEGER var;

var = 3;

if(room\>0 && room \<= 5)

{

   print("The location is %d\n", location[var]);

}

print("The location is %d\n", location[room]);

Version:

X Generation: Not Supported.

2-Series: SIMPL v2.10.24 or later, CUZ 4.000 or later.

  [Allowable Ranges for 2 Series Numeric Formats]: ../../Allowable_Ranges_for_2_Series_Numeric_Formats.md
  [Parameter Property Blocks]: ../Compiler_Directives/PARAMETER_PROPERTIES.md
  [_SKIP_]: javascript:void(0);

Language Constructs & Functions
Declarations
LONG INTEGER PARAMETER
LONG_INTEGER_PARAMETER


Nonvolatile

# Nonvolatile

Name:

Nonvolatile

Syntax:

   Nonvolatile

NOTE:  This is not a declaration but a declaration modifier. It works only in conjunction with another declaration keyword.

Description:

Global integer and string program variables will retain their value if hardware power is lost.

Example:

    Nonvolatile integer n;

    Nonvolatile string s[100];

Version:

X Generation:  Not Supported

2-Series:  SIMPL v2.01.05 and later

Language Constructs & Functions
Declarations
NONVOLATILE
Nonvolatile


SIGNED_INTEGER

# SIGNED_INTEGER

Name:

SIGNED_INTEGER

Syntax:

SIGNED_INTEGER \<var1\>[,\<var2\>...];

SIGNED_INTEGER \<var1\>[size] [,\<var2\>[size]…];

SIGNED_INTEGER \<var1\>[rows1][columns1] [,\<var2\>[rows2][columns2]…];

Description:

The first form declares an integer value that is local to this SIMPL+ program. SIGNED_INTEGER values are 16-bit quantities ranging from -32678 to 32767.

The second form declares a one-dimensional array of SIGNED_INTEGER values.

The third form declares a two-dimensional array of SIGNED_INTEGER values. A two-dimensional array can be thought of as a table or matrix.

The values for SIZE, ROWS, and COLUMNS may be up to 65534.

A SIGNED_INTEGER array element may be used anywhere an SIGNED_INTEGER is legal. Array elements are referenced by using the name followed by [element] for one-dimensional arrays or [row][column] for two-dimensional arrays. The element number may range from 0 to the element size. For example, if an array is declared as NUM[2], then legal elements are NUM[0], NUM[1], and NUM[2]. The bracket notation is often called an array subscript.

NOTE:  SIGNED_INTEGERs can be volatile or non-volatile. The default is defined using the compiler directives #DEFAULT_NONVOLATILE or #DEFAULT_VOLATILE or overriden using the nonvolatile or volatile keywords.

Example:

SIGNED_INTEGER temp_level;

Specifies one locally declared SIGNED_INTEGER in this SIMPL+ program

SIGNED_INTEGER CommandBytes[2];

Specifies an array of three SIGNED_INTEGERS that can be referenced under the name CommandBytes. In pictorial form, it appears as:

|                   |                   |                   |
|-------------------|-------------------|-------------------|
| CommandBytes[0] | CommandBytes[1] | CommandBytes[2] |

SIGNED_INTEGER Matrix[4][3];

Specifies a two-dimensional array of integers five rows deep by four columns wide. In pictorial form, it appears as:

|                  |                  |                  |                  |
|------------------|------------------|------------------|------------------|
| Matrix[0][0] | Matrix[0][1] | Matrix[0][2] | Matrix[0][3] |
| Matrix[1][0] | Matrix[1][1] | Matrix[1][2] | Matrix[1][3] |
| Matrix[2][0] | Matrix[2][1] | Matrix[2][2] | Matrix[2][3] |
| Matrix[3][0] | Matrix[3][1] | Matrix[3][2] | Matrix[3][3] |
| Matrix[4][0] | Matrix[4][1] | Matrix[4][2] | Matrix[4][3] |

NOTE:  The subscripts of an array may be an expression, i.e.:

               SIGNED_INTEGER location[5], room;

               room = 2;

               location[room] = 10;

Version:

X Generation:  Not Supported

2-Series:  SIMPL v2.02.10 and later

Language Constructs & Functions
Declarations
SIGNED INTEGER
SIGNED_INTEGER


SIGNED_INTEGER_PARAMETER

# SIGNED_INTEGER_PARAMETER

Name:

SIGNED_INTEGER_PARAMETER

Syntax:

    SIGNED_INTEGER_PARAMETER \<var1\>[,\<var2\>...];

    SIGNED_INTEGER_PARAMETER \<var1\>[size] [,\<var2\>[size]…];

Description:

The first form declares a SIGNED_INTEGER_PARAMETER value that is local to this SIMPL+ program.

The second form declares a one dimensional array of SIGNED_INTEGER_PARAMETER values.

The values for SIZE may be up to 65534.

The actual value for the parameter is entered as a parameter to the SIMPL+ module when the SIMPL+ module is used the SIMPL program.  The parameter has a default range of legal values.  Since parameters can be entered in various formats (percentage, hex, decimal, time, etc.), please see [Allowable Ranges for 2 Series Numeric Formats] to find the valid ranges for the various types.

SIMPL+ Parameters may have further programmatic restrictions placed on them, similar to parameter property sheets for SIMPL modules.  The programmer can restrict the range, only allow certain values to be entered, assume default values, restrict types of units entered among others restrictions.  For more information, please see [Parameter Property Blocks]

A SIGNED_INTEGER_PARAMETER array element may be used anywhere a SIGNED_INTEGER is legal, with the caveat that it may not be written to.  Array elements are referenced by using the name followed by [element]. The element number may range from 1 to the element size. For example, if an array is declared as NUM[2], then legal elements are NUM[1], and NUM[2]. The bracket notation is often called an array subscript.

NOTE: The [_SKIP_] keyword can be used in INTEGER_PARAMETER, LONG_INTEGER_PARAMETER, SIGNED_INTEGER_PARAMETER, SIGNED_LONG_INTEGER_PARAMETER and STRING_PARAMETER declarations.

Example:

    SIGNED_INTEGER_PARAMETER temp_level;

Specifies one SIGNED_INTEGER_PARAMETER with the name temp_level in this SIMPL+ program

    SIGNED_INTEGER_PARAMETER CommandBytes[2];

Specifies an array of two SIGNED_INTEGER_PARAMETERS that can be referenced under the name CommandBytes.

 NOTE:  The subscripts of an array may be any positive valid integral expression as shown by the example below.

SIGNED_INTEGER_PARAMETER location[5], room;

SIGNED_INTEGER var;

var = 3;

if(room\>0 && room \<= 5)

{

   print("The location is %d\n", location[var]);

}

print("The location is %d\n", location[room]);

Version:

X Generation:

Not Supported.

2-Series:

SIMPL v2.10.24 or later, CUZ 4.000 or later.

  [Allowable Ranges for 2 Series Numeric Formats]: ../../Allowable_Ranges_for_2_Series_Numeric_Formats.md
  [Parameter Property Blocks]: ../Compiler_Directives/PARAMETER_PROPERTIES.md
  [_SKIP_]: javascript:void(0);

Language Constructs & Functions
Declarations
SIGNED INTEGER PARAMETER
SIGNED_INTEGER_PARAMETER


SIGNED_LONG_INTEGER

# SIGNED_LONG_INTEGER

Name:

SIGNED_LONG_INTEGER

Syntax:

SIGNED_LONG_INTEGER \<var1\>[,\<var2\>...];

  SIGNED_LONG_INTEGER \<var1\>[size] [,\<var2\>[size]…];

  SIGNED_LONG_INTEGER \<var1\>[rows1][columns1] [,\<var2\>[rows2][columns2]…];

Description:

The first form declares a long value that is local to this SIMPL+ program. SIGNED_LONG_INTEGER values are 32-bit quantities ranging from -2,147,483,648 to 2,147,483,647.

The second form declares a one-dimensional array of SIGNED_LONG_INTEGER values.

The third form declares a two-dimensional array of SIGNED_LONG_INTEGERvalues. A two-dimensional array can be thought of as a table or matrix.

The values for SIZE, ROWS, and COLUMNS may be up to 65534.

A SIGNED_LONG_INTEGER array element may be used anywhere a SIGNED_LONG_INTEGER is legal. Array elements are referenced by using the name followed by [element] for one-dimensional arrays or [row][column] for two-dimensional arrays. The element number may range from 0 to the element size. For example, if an array is declared as NUM[2], then legal elements are NUM[0], NUM[1], and NUM[2]. The bracket notation is often called an array subscript.

NOTE:  (2-Series) SIGNED_LONG_INTEGERs can be volatile or non-volatile. The default is defined using the compiler directives #DEFAULT_NONVOLATILE or #DEFAULT_VOLATILE or overriden using the nonvolatile or volatile keywords.

Example:

   SIGNED_LONG_INTEGER temp_level;

Specifies one locally declared SIGNED_LONG_INTEGER in this SIMPL+ program

    SIGNED_LONG_INTEGER CommandBytes[2];

Specifies an array of three SIGNED_LONG_INTEGERs that can be referenced under the name CommandBytes. In pictorial form, it appears as:

|                   |                   |                   |
|-------------------|-------------------|-------------------|
| CommandBytes[0] | CommandBytes[1] | CommandBytes[2] |

    SIGNED_LONG_INTEGER Matrix[4][3];

Specifies a two-dimensional array of SIGNED_LONG_INTEGERs five rows deep by four columns wide. In pictorial form, it appears as:

|                  |                  |                  |                  |
|------------------|------------------|------------------|------------------|
| Matrix[0][0] | Matrix[0][1] | Matrix[0][2] | Matrix[0][3] |
| Matrix[1][0] | Matrix[1][1] | Matrix[1][2] | Matrix[1][3] |
| Matrix[2][0] | Matrix[2][1] | Matrix[2][2] | Matrix[2][3] |
| Matrix[3][0] | Matrix[3][1] | Matrix[3][2] | Matrix[3][3] |
| Matrix[4][0] | Matrix[4][1] | Matrix[4][2] | Matrix[4][3] |

NOTE:  The subscripts of an array may be an expression, i.e.:

               SIGNED_LONG_INTEGER location[5], room;

               room = 2;

               location[room] = 10;

Version:

X Generation:  Not Supported

2-Series:  SIMPL v2.02.10 and later

Language Constructs & Functions
Declarations
SIGNED LONG INTEGER
SIGNED_LONG_INTEGER


SIGNED_LONG_INTEGER_PARAMETER

# SIGNED_LONG_INTEGER_PARAMETER

Name:

SIGNED_LONG_INTEGER_PARAMETER

Syntax:

    SIGNED_LONG_INTEGER_PARAMETER \<var1\>[,\<var2\>...];

    SIGNED_LONG_INTEGER_PARAMETER \<var1\>[size] [,\<var2\>[size]…];

Description:

The first form declares a SIGNED_LONG_INTEGER_PARAMETER value that is local to this SIMPL+ program.

The second form declares a one dimensional array of SIGNED_LONG_INTEGER_PARAMETER values.

The values for SIZE may be up to 65534.

The actual value for the parameter is entered as a parameter to the SIMPL+ module when the SIMPL+ module is used the SIMPL program.  The parameter has a default range of legal values.  Since parameters can be entered in various formats (percentage, hex, decimal, time, etc.), please see [Allowable Ranges for 2 Series Numeric Formats] to find the valid ranges for the various types.

SIMPL+ Parameters may have further programmatic restrictions placed on them, similar to parameter property sheets for SIMPL modules.  The programmer can restrict the range, only allow certain values to be entered, assume default values, restrict types of units entered among others restrictions.  For more information, please see [Parameter Property Blocks]

A SIGNED_LONG_INTEGER_PARAMETER array element may be used anywhere a SIGNED_LONG_INTEGER is legal, with the caveat that it may not be written to.  Array elements are referenced by using the name followed by [element]. The element number may range from 1 to the element size. For example, if an array is declared as NUM[2], then legal elements are NUM[1], and NUM[2]. The bracket notation is often called an array subscript.

NOTE: The [_SKIP_] keyword can be used in INTEGER_PARAMETER, LONG_INTEGER_PARAMETER, SIGNED_INTEGER_PARAMETER, SIGNED_LONG_INTEGER_PARAMETER and STRING_PARAMETER declarations.

Example:

    SIGNED_LONG_INTEGER_PARAMETER temp_level;

Specifies one SIGNED_LONG_INTEGER_PARAMETER with the name temp_level in this SIMPL+ program

    SIGNED_LONG_INTEGER_PARAMETER CommandBytes[2];

Specifies an array of two SIGNED_LONG_INTEGER_PARAMETERS that can be referenced under the name CommandBytes.

 NOTE:  The subscripts of an array may be any positive valid integral expression as shown in the example below.:

SIGNED_LONG_INTEGER_PARAMETER location[5], room;

SIGNED_LONG_INTEGER var;

var = 3;

if(room\>0 && room \<= 5)

{

   print("The location is %d\n", location[var]);

}

print("The location is %d\n", location[room]);

Version:

X Generation: Not Supported.

2-Series: SIMPL v2.10.24 or later, CUZ 4.000 or later.

  [Allowable Ranges for 2 Series Numeric Formats]: ../../Allowable_Ranges_for_2_Series_Numeric_Formats.md
  [Parameter Property Blocks]: ../Compiler_Directives/PARAMETER_PROPERTIES.md
  [_SKIP_]: javascript:void(0);

Language Constructs & Functions
Declarations
SIGNED LONG INTEGER PARAMETER
SIGNED_LONG_INTEGER_PARAMETER


STRING

# STRING

Name:

STRING

Syntax:

    STRING \<var1[size1]\>[,\<var2[size2]\>...];

    STRING \<var1[num_elements1][num_characters1]\>[,

           \<var2[num_elements2][num_characters2]\>...];

Description:

Declares a string that is local to this SIMPL+ program. Strings are of arbitrary length, so a maximum size must be specified. When a STRING variable has new data assigned to it, the old data is lost.

NOTE:  Strings in Version 3.00 for the 2-Series Control Systems may not be passed by value to a function.  They must be passed by reference.

NOTE: If no Return Value is specified within an String_Function, then an empty string will be returned by default.

When used in its second form, a one-dimensional array of strings is allocated. The array has num_elements+1 elements, and num_characters per element allocated. The legal indices for referencing the strings are 0 through num_elements.

The value of SIZE and NUM_CHARACTER may be up to 255 in SIMPL+ Version 1.00. In SIMPL+ Version 2.00 and later, they may be up to 65534. The value of NUM_ELEMENTS may be up to 65535.

NOTE:  (X-Gen) The values of STRINGs declared are non-volatile. If the system is powered down and up, the variables will take on their previous values. If programs are changed and uploaded, the values are not preserved.

NOTE:  (2-Series) STRINGs can be volatile or non-volatile. The default is defined using the compiler directives #DEFAULT_NONVOLATILE or #DEFAULT_VOLATILE or overriden using the nonvolatile or volatile keywords.

Example:

    STRING temp$[10];

Signifies that one local STRING is declared in this SIMPL+ program.

    STRING temp$[2][10];

Signifies that three strings of 10 characters long have been allocated.

To assign values, the following would be legal:

    temp$[0]="Val1";

    temp$[1]="Val2";

    temp$[2]="Val3";

Version:

X Generation

SIMPL v1.20.01 and later

SIMPL v1.50.06 and later, SIZE and NUM_CHARACTER up to 65534.

2-Series

SIMPL v2.01.05 and later, [Same as X Generation SIMPL v1.50.06]

Language Constructs & Functions
Declarations
STRING


STRING_INPUT

# STRING_INPUT

Name:

STRING_INPUT

Syntax:

STRING_INPUT \<var1[max_size1]\>[,\<var2[max_size2]\>...];

STRING_INPUT \<var[size][max_size]\>;

STRING_INPUT \<var[size[,\<min\>]][max_size]\>;

STRING_INPUT \<var1\>[,[_SKIP_]][,\<var2\>...];

Description:

Routes serial inputs from the outside SIMPL program into a SIMPL+ program under the specified variable names. Strings are of arbitrary length, so a maximum size must be specified. Upon receiving new data, the value is cleared and the new string is put in. Strings received greater than the specified size are truncated to the size in the declaration. String inputs may be written to, so their data space may be used as a storage spot for doing something such as parsing through a string without declaring temporary storage. Refer to the discussion on fixed and variable arrays in [Declarations Overview.]

NOTE:  STRING_INPUT variables may not be passed to functions in Version 3.00 for the 2-Series Control Systems. If you need to pass a STRING_INPUT variable to a function, assign it to a locally declared variable and pass that variable to the function.

The value of SIZE and NUM_CHARACTER may be up to 255 in SIMPL+ Version 1.00. In SIMPL+ Version 2.00 and later, they may be up to 65535. For an array of STRING_INPUTs, the maximum value of SIZE is 65535.

NOTE: \<min\> is the number of inputs shown at a minimum, in SIMPL the default is 1. The user can expand the minimum up to the full size. Only the last array of a type can have a \<min\>.

NOTE: The [_SKIP_] keyword can be used in DIGITAL_INPUT, DIGITAL_OUTPUT, ANALOG_INPUT, ANALOG_OUTPUT, BUFFER_INPUT, STRING_INPUT and STRING_OUTPUT declarations.

Example:

STRING_INPUT FirstName[100], SecondName[25];

Signifies that two serial inputs are coming into the SIMPL+ program from the SIMPL Program. The first one may only be a maximum of 100 characters, the second may only be a maximum of 25 characters. If an input is longer than the specified length, everything after the specified limit is lost.

STRING_INPUT DataBaseNames[9][100];

Signifies that 9 serial inputs are coming into the SIMPL+ program from the SIMPL program. Each name has a 100 character limit. The names are referenced as DataBaseNames[1] through DataBaseNames[9].

STRING_INPUT Database Names [9,3][100];

Same as above except at least three are shown at all times

Version:

X Generation

SIMPL v1.20.01 and later

SIMPL v1.50.06 and later, STRING_INPUT arrays and SIZE, NUM_CHARACTER to 65534.

2-Series

SIMPL v2.01.05 and later, [Same as X Generation SIMPL v1.50.06]

SIMPL v2.03.18 and later, for fixed arrays and minimum sizes.

  [_SKIP_]: javascript:void(0);
  [Declarations Overview.]: Declarations_Overview.md

Language Constructs & Functions
Declarations
STRING INPUT
STRING_INPUT


STRING_OUTPUT

# STRING_OUTPUT

Name:

STRING_OUTPUT

Syntax:

STRING_OUTPUT \<var1\>[,\<var2\>...];

STRING_OUTPUT \<var[size]\>;

STRING_OUTPUT \<var[size[,\<min\>]][size]\>;

STRING_OUTPUT \<var1\>[,[_SKIP_]][,\<var2\>...];

Description:

Routes serial strings from the SIMPL+ program to the SIMPL program. A string length is not required as the output string buffer management is performed by the operating system. Refer to the discussion on fixed and variable arrays in [Declarations Overview.]

NOTE:  These outputs may be jammed with other serial string signals in the SIMPL program, although the value does not propagate back into the SIMPL+ symbol.

NOTE: You should use [isSignalDefined] to test whether the output is connected to an actual signal in the SIMPL program before assigning a value to it. If you assign a value and there is no signal, a message is placed in the system error log.

NOTE:  The maximum string length for a STRING_OUTPUT is 255 characters. Assigning a string with a length of more than 255 will result in a loss of data.

The value of a STRING_OUTPUT cannot be read. If knowledge of the value of the STRING_OUTPUT is required, the value to be written to the STRING_OUTPUT can also be written to a STRING for local storage.

In X-Generation Control Systems, if several values are issued to a STRING_OUTPUT, the logic will only see the last value written to the STRING_OUTPUT when the SIMPL+ program task switches away. If all values are required to be seen by the logic, a PROCESSLOGIC statement is required after writing to the STRING_OUTPUT.

In the 2-Series Control Systems, all values written to a STRING_OUTPUT are maintained. The logic will see each value of the STRING_OUTPUT. No PROCESSLOGIC is required.

For an array of STRING_OUTPUTs, the maximum value of SIZE is 65535. Valid indices are 1 through the specified size.

NOTE: \<min\> is the number of outputs shown at a minimum, in SIMPL the default is 1. The user can expand the minimum up to the full size. Only the last array of a type can have a \<min\>.

NOTE: The [_SKIP_] keyword can be used in DIGITAL_INPUT, DIGITAL_OUTPUT, ANALOG_INPUT, ANALOG_OUTPUT, BUFFER_INPUT, STRING_INPUT and STRING_OUTPUT declarations.

Example:

STRING_OUTPUT TheName$;

Signifies one string called TheName$ that is generated by the SIMPL+ program and sent to the SIMPL program.

STRING_OUTPUT SortedNames$[5];

Specifies five strings that are generated by the SIMPL+ program and sent to the SIMPL program. The names are referred to as SortedNames[1] through SortedNames[5].

STRING_OUTPUT SortedNames$[5,5];

Same as above except all five are always shown.

Version:

X Generation

SIMPL v1.20.01 and later

SIMPL v1.50.06 and later, STRING_OUTPUT Arrays

2-Series

SIMPL v2.01.05 and later [Same support as X Generation SIMPL v1.50.06, however, STRING_OUTPUTs or STRING_OUTPUT Arrays cannot be passed by reference]

SIMPL v2.03.18 and later, Fixed size arrays and minimum sizes.

  [_SKIP_]: javascript:void(0);
  [Declarations Overview.]: Declarations_Overview.md
  [isSignalDefined]: ../System_Interfacing/IsSignalDefined.md

Language Constructs & Functions
Declarations
STRING OUTPUT
STRING_OUTPUT


STRING_PARAMETER

# STRING_PARAMETER

Name:

STRING_PARAMETER

Syntax:

    STRING_PARAMETER \<var1[size1]\>[,\<var2[size2]\>...];

    STRING_PARAMETER \<var1[num_elements1][num_characters1]\>[,

           \<var2[num_elements2][num_characters2]\>...];

Description:

The first form declares a STRING_PARAMETER value that is local to this SIMPL+ program.

The second form declares a one dimensional array of STRING_PARAMETER values.

The values for SIZE may be up to 65534.  Note that at runtime, the string is truncated to this length if the string specified in SIMPL is longer.

The actual value for the parameter is entered as a parameter to the SIMPL+ module when the SIMPL+ module is used the SIMPL program.

STRING_PARAMETERs may have programmatic restrictions placed on them, similar to parameter property sheets for SIMPL modules.  The programmer can allow certain values to be entered, assume default values, among others restrictions.  For more information, please see [Parameter Property Blocks]

A STRING_PARAMETER array element may be used anywhere a STRING is legal, with the caveat that it may not be written to.  Array elements are referenced by using the name followed by [element]. The element number may range from 1 to the element size. For example, if an array is declared as NUM[2], then legal elements are NUM[1], and NUM[2]. The bracket notation is often called an array subscript..

NOTE: The [_SKIP_] keyword can be used in INTEGER_PARAMETER, LONG_INTEGER_PARAMETER, SIGNED_INTEGER_PARAMETER, SIGNED_LONG_INTEGER_PARAMETER and STRING_PARAMETER declarations.

Example:

    STRING_PARAMETER SystemName[10];

Signifies that one local STRING_PARAMETER of 10 bytes wide is declared in this SIMPL+ program and named "SystemName"

    STRING_PARAMETER Labels[2][10];

Signifies that two strings of 10 characters long have been allocated and referenced by the array name "Labels".  To reference an element, simply use the [] index notation:

    Print("The value of parameter 1 is %s\n", Labels[1]);

 Version:

X Generation: Not Supported.

2-Series: SIMPL v2.10.24 or later, CUZ 4.000 or later.

  [Parameter Property Blocks]: ../Compiler_Directives/PARAMETER_PROPERTIES.md
  [_SKIP_]: javascript:void(0);

Language Constructs & Functions
Declarations
STRING PARAMETER
STRING_PARAMETER


STRUCTURES

# STRUCTURES

A structure is a collection of one or more variables grouped together under a single name.  These variables, called structure fields or members, may consist of both integer and string datatypes.  Structures help organize related data because they allow variables to be grouped together as a unit instead of as separate entities.

Structure datatypes can be defined globally within a SIMPL+ module (\*.usp file) and/or within a SIMPL+ library (\*.usl file).  Variables of a defined structure datatype may be declared both globally and locally and passed as function arguments.  Structures are always passed to functions by reference.  INTEGER, LONG_INTEGER, SIGNED_INTEGER, SIGNED_LONG_INTEGER and STRING are the only SIMPL+ datatypes allowed to be used as structure member fields.  INTEGER and LONG_INTEGER can include 1 and 2 dimensional arrays.  String arrays are not permitted.

 The syntax for defining a structure is as follows:

STRUCTURE struct_name

{

type member1;

type member2;

.

.

.

type memberN;

};

The keyword, STRUCTURE, tells the compiler that a new datatype is being defined.  Each type is one of the SIMPL+ datatypes, INTEGER, LONG_INTEGER, SIGNED_INTEGER, SIGNED_LONG_INTEGER or STRING.  struct_name is the name for the structure that will be used as the new datatype.

Declaring a variable of a structure datatype is as follows:

struct_name var_name;

An example of a structure would be an entry in a phone book.  The phone book contains many entries, all containing the same three pieces of information:  the person’s name, address and phone number.  The structure would be defined as follows:

STRUCTURE PhoneBookEntry

{

STRING Name[50];

STRING Address[100];

STRING PhoneNumber[20];

};

PhoneBookEntry OneEntry;

PhoneBookEntry Entry[500];

In this example, the name, PhoneBookEntry, is the datatype defined that will encapsulate the structure fields, Name, Address and PhoneNumber.  Two variables are then defined to be of this datatype.  The variable, OneEntry, is a variable that contains one instance of the datatype, PhoneBookEntry.  The variable, Entry, is then defined to be an array of the datatype, PhoneBookEntry consisting of 501 individual instances, namely Entry[0] to Entry[500].

To access a structure’s field, the structure’s declared variable name is used, followed by a period (also known as the ‘dot’ or ‘dot operator’), then followed by a structure member variable name.

From the example above, accessing the Name field from the declared variable would be written as follows:

OneEntry.Name

or

Entry[5].Name

Using this in a SIMPL+ statement might look as follows:

If ( OneEntry.Name = "David" )

Return;

If ( Entry[5].Name = "David" )

Return;

Passing structures as function arguments is as follows:

FUNCTION myFunction ( PhoneBookEntry argOneEntry,

PhoneBookEntry argEntry[] )

{

if ( argOneEntry.Name = "David" )

return;

if ( argEntry[5].Name = "David" )

return;

}

Version:

X Generation:  Not Supported

2-Series:  SIMPL v2.02.10 and later

Language Constructs & Functions
Declarations
STRUCTURES

FUNCTION INTEGER If LONG_INTEGER SIGNED_INTEGER SIGNED_LONG_INTEGER STRING STRUCTURE STRUCTURES


Volatile

# Volatile

Name:

Volatile

Syntax:

   Volatile

NOTE:  This is not a declaration but a declaration modifier. It works only in conjunction with another declaration keyword.

Description:

Global integer and string program variables will not retain their value if hardware power is lost.

Example:

    Volatile integer n;

    Volatile string s[100];

Version:

X Generation:  Not Supported

2-Series:  SIMPL v2.01.05 and later

Language Constructs & Functions
Declarations
VOLATILE
Volatile


Direct Socket Access Example Code (Part 1)

# Direct Socket Access Example Code

#DEFINE_CONSTANT    FALSE        0

#DEFINE_CONSTANT    TRUE         1

//#DEFINE_CONSTANT    INCLUDE_NEW_CODE    1

DIGITAL_INPUT diStartClient;

DIGITAL_INPUT diClientReconnectEnable;

DIGITAL_INPUT diEnableServer;

DIGITAL_INPUT diEnableUDP;

ANALOG_INPUT aiClientPortNumber;

ANALOG_INPUT aiServerPortNumber;

ANALOG_INPUT aiUDP_PortNumber;

STRING_INPUT siClientIPAddress[256];

STRING_INPUT siServerIPAddress[256];

STRING_INPUT siUDP_IPAddress[256];

STRING_INPUT siClientTx[256];

STRING_INPUT siServerTx[256];

STRING_INPUT siUDP_Tx[256];

DIGITAL_OUTPUT doClientConnected;

DIGITAL_OUTPUT doServerConnected;

ANALOG_OUTPUT  aoClientStatus;

ANALOG_OUTPUT  aoServerStatus;

STRING_OUTPUT  soClientRx;

STRING_OUTPUT  soServerRx;

STRING_OUTPUT  soUDP_Rx;

TCP_CLIENT MyClient[1024];

TCP_SERVER MyServer[1024];

UDP_SOCKET MyUDP[1024];

// Client Example Code

PUSH diStartClient

{

    SIGNED_INTEGER status;

    status = SocketConnectClient (MyClient, siClientIPAddress, aiClientPortNumber, diClientReconnectEnable);

    if (status \< 0)

        Print("Error connecting socket to address %s on port  %d",

            SiClientIPAddress, aiClientPortNumber);

}

RELEASE diStartClient

{

    SIGNED_INTEGER status;

    status = SocketDisconnectClient (MyClient);

if (status \< 0)

    Print("Error disconnecting socket to address %s on port  %d",

            SiClientIPAddress, aiClientPortNumber);

}

SOCKETCONNECT MyClient

{

    SIGNED_LONG_INTEGER PortNumber;

    SIGNED_INTEGER LocalStatus;

    STRING RemoteIPAddress[20];

    STRING RequestedAddress[256];

    doClientConnected = 1;

    LocalStatus = SocketGetAddressAsRequested(MyClient, RequestedAddress);

    if (LocalStatus \< 0)

        Print("Error getting remote ip address. %d\n", LocalStatus);

    Print("OnConnect: Connect call to %s successful\n", RequestedAddress);

    PortNumber = SocketGetPortNumber(MyClient);

    if (PortNumber \< 0)

        Print("Error getting client port number. %ld\n", PortNumber);

    LocalStatus = SocketGetRemoteIPAddress(MyClient, RemoteIPAddress);

    if (LocalStatus \< 0)

        Print("Error getting remote ip address. %d\n", LocalStatus);

    Print("OnConnect: Connected to port %ld on address %s\n",

                PortNumber, RemoteIPAddress);

    SocketSend(MyClient, "This is sent when the socket starts.");

}

SOCKETDISCONNECT MyClient

{

    doClientConnected = 0;

    if (diStartClient)

        Print("Socket disconnected remotely");

    Else

        Print("Local disconnect complete.");

}

SOCKETSTATUS MyClient

{

    SIGNED_INTEGER Status;

    Status = SocketGetStatus();

    aoClientStatus = Status;

    Print("The SocketGetStatus returns:       %d\n", Status);

    Print("The MyClient.SocketStatus returns: %d\n", MyClient.SocketStatus);

}

SOCKETRECEIVE MyClient

{

    if (Len(MyClient.SocketRxBuf) \< 256)

        Print("Rx: %s", MyClient.SocketRxBuf);

    // for now, send to serial output and clear buffer

    soClientRx = MyClient.SocketRxBuf;

    ClearBuffer(MyClient.SocketRxBuf);

}

CHANGE siClientTx

{

    signed_integer iStatus;

    iStatus = SocketSend(MyClient, siClientTx );

    if (iStatus \< 0)

        Print("Error Sending to MyClient: %d\n", iStatus);

}

// Server Example code

PUSH diEnableServer

{

    SIGNED_INTEGER status;

    status = SocketServerStartListen(MyServer, siServerIPAddress, aiServerPortNumber);

    if (status \< 0)

Language Constructs & Functions
Direct Socket Access
Direct Socket Access Example Code
Direct Socket Access Example Code


Direct Socket Access Example Code (Part 2)

        Print("Error listening to %s on port %u (status: %d)", siServerIPAddress, aiServerPortNumber, status);

}

RELEASE diEnableServer

{

    SIGNED_INTEGER status;

    status = SocketServerStopListen(MyServer);

    if (status \< 0)

        Print("Error stopping server (status: %d)", status);

}

SOCKETCONNECT MyServer

{

    SIGNED_INTEGER PortNumber;

    doServerConnected = 1;

    Print("OnConnect: input buffer size is: %d\n", Len(MyServer.SocketRxBuf));

    SocketSend(MyServer, "This is sent when the socket starts.");

}

SOCKETDISCONNECT MyServer

{

    doServerConnected = 0;

    if (diEnableServer)

        Print("Socket disconnected remotely");

    Else

        Print("Local disconnect complete.");

}

SOCKETSTATUS MyServer

{

    SIGNED_INTEGER Status;

    Status = SocketGetStatus();

    aoServerStatus = Status;

    Print("The SocketGetStatus returns:       %d\n", Status);

    Print("The MyServer.SocketStatus returns: %d\n", MyServer.SocketStatus);

}

SOCKETRECEIVE MyServer

{

    if (Len(MyServer.SocketRxBuf) \< 256)

        Print("Rx: %s", MyServer.SocketRxBuf);

    // for now, send to serial output and clear buffer

    soServerRx = MyServer.SocketRxBuf;

    ClearBuffer(MyServer.SocketRxBuf);

}

CHANGE siServerTx

{

    signed_integer iStatus;

    iStatus = SocketSend(MyServer, siServerTx );

    if (iStatus \< 0)

        Print("Error Sending to MyServer: %d\n", iStatus);

}

// UDP Example code

PUSH diEnableUDP

{

    SIGNED_INTEGER status;

    status = SocketUDP_Enable(MyUDP, siUDP_IPAddress, aiUDP_PortNumber);

    if (status \< 0)

        Print("Error listening to %s on port  %d", siUDP_IPAddress, aiUDP_PortNumber);

}

RELEASE diEnableUDP

{

    SIGNED_INTEGER status;

    status = SocketUDP_Disable (MyUDP);

    if (status \< 0)

        Print("Error listening on port  %d", aiServerPortNumber);

}

SOCKETRECEIVE MyUDP

{

    SIGNED_INTEGER IsBroadcast;

    SIGNED_INTEGER IsMulticast;

    SIGNED_INTEGER LocalStatus;

    STRING SenderIPAddress[32];

    IsBroadcast = SocketIsBroadcast(MyUDP);

    if (IsBroadcast \< 0)

        Print("IsBroadcast returned error: %d\n", IsBroadcast);

    IsMulticast = SocketIsMulticast(MyUDP);

    if (IsMulticast \< 0)

        Print("IsMulticast returned error: %d\n", IsMulticast);

    LocalStatus = SocketGetSenderIPAddress(MyUDP, SenderIPAddress);

    if (LocalStatus \< 0)

        Print("SocketGetSenderIPAddress returned error: %d\n", LocalStatus);

    if (IsBroadcast)

        Print("Broadcast data received from %s\n", SenderIPAddress);

    else if (IsMulticast)

        Print("Multicast data received from %s\n", SenderIPAddress);

    else

        Print("Unicast data received from %s\n", SenderIPAddress);

    if (Len(MyUDP.SocketRxBuf) \< 256)

        Print("Rx: %s", MyUDP.SocketRxBuf);

    // for now, send to serial output and clear buffer

    soUDP_Rx = MyUDP.SocketRxBuf;

    ClearBuffer(MyUDP.SocketRxBuf);

}

CHANGE siUDP_Tx

{

    signed_integer iStatus;

    iStatus = SocketSend(MyUDP, siUDP_Tx );

    if (iStatus \< 0)

        Print("Error Sending to MyUDP: %d\n", iStatus);

}

Access CHANGE ClearBuffer Code Direct Example Len PUSH Part Print RELEASE SIGNED_INTEGER STRING Socket SocketGetSenderIPAddress SocketGetStatus SocketIsBroadcast SocketIsMulticast SocketSend SocketServerStopListen

%ld\n", PortNumber);

    LocalStatus = SocketGetRemoteIPAddress(MyClient, RemoteIPAddress);

    if (LocalStatus \< 0)

        Print("Error getting remote ip address. %d\n", LocalStatus);

    Print("OnConnect: Connected to port %ld on address %s\n",

                PortNumber, RemoteIPAddress);

    SocketSend(MyClient, "This is sent when the socket starts.");

}

SOCKETDISCONNECT MyClient

{

    doClientConnected = 0;

    if (diStartClient)

        Print("Socket disconnected remotely");

    Else

        Print("Local disconnect complete.");

}

SOCKETSTATUS MyClient

{

    SIGNED_INTEGER Status;

    Status = SocketGetStatus();

    aoClientStatus = Status;

    Print("The SocketGetStatus returns:       %d\n", Status);

    Print("The MyClient.SocketStatus returns: %d\n", MyClient.SocketStatus);

}

SOCKETRECEIVE MyClient

{

    if (Len(MyClient.SocketRxBuf) \< 256)

        Print("Rx: %s", MyClient.SocketRxBuf);

    // for now, send to serial output and clear buffer

    soClientRx = MyClient.SocketRxBuf;

    ClearBuffer(MyClient.SocketRxBuf);

}

CHANGE siClientTx

{

    signed_integer iStatus;

    iStatus = SocketSend(MyClient, siClientTx );

    if (iStatus \< 0)

        Print("Error Sending to MyClient: %d\n", iStatus);

}

// Server Example code

PUSH diEnableServer

{

    SIGNED_INTEGER status;

    status = SocketServerStartListen(MyServer, siServerIPAddress, aiServerPortNumber);

    if (status \< 0)


Direct Socket Access Functions Overview (Part 1)

# Direct Socket Access Functions Overview

Socket functions make it possible for SIMPL+ to access the Internet, or even simply use Ethernet, without the necessity of going through the SIMPL program. This is important because SIMPL imposes a returned character limit that would truncate a web page or string after about 255 characters. SIMPL+ does not have this limitation so socket functions through SIMPL+ are highly desirable.

There are three socket types implemented in SIMPL+ and they are treated as new I/O data types: TCP/IP clients (TCP_CLIENT), TCP/IP server (TCP_SERVER) and UDP socket (UDP_SOCKET). These three sockets each use a pre-defined structure called SOCKET_STRUCT to access the variables and functions in the table later in this topic.

NOTE: Declarations of direct socket types must come after all input and output declarations.  The reason for this is that the implied receive buffer for each socket will be indexed starting from the last string or buffer input.

The implied structure of client, server and UDP socket SOCKET_STRUCT is shown immediately below.

    STRUCTURE SOCKET_STRUCT

        {

             INTEGER SocketStatus;

             STRING  SocketRxBuf;

        }TCP_CLIENT, TCP_SERVER, UDP_SOCKET

where;

Status equals the current status of the socket. The following returned values are comparable to those in the TCP/IP Client and Server symbols:

|                               |       |                            |
|-------------------------------|-------|----------------------------|
| Keyword                       | Value | Connection Status          |
| SOCKET_STATUS_NO_CONNECT      | 0     | Not Connected              |
| SOCKET_STATUS_WAITING         | 1     | Waiting for Connection     |
| SOCKET_STATUS_CONNECTED       | 2     | Connected                  |
| SOCKET_STATUS_CONNECT_FAILED  | 3     | Connection Failed          |
| SOCKET_STATUS_BROKEN_REMOTELY | 4     | Connection Broken Remotely |
| SOCKET_STATUS_BROKEN_LOCALLY  | 5     | Connection Broken Locally  |
| SOCKET_STATUS_DNS_LOOKUP      | 6     | Performing DNS Lookup      |
| SOCKET_STATUS_DNS_FAILED      | 7     | DNS Lookup Failed          |
| SOCKET_STATUS_DNS_RESOLVED    | 8     | DNS Name Resolved          |

String contains received serial data from the socket.

The error codes that can be returned by Direct Socket Access functions are listed in the following table.

|  |  |  |
|----|----|----|
| Keyword | Value | Connection Status |
| SOCKET_INVALID_SOCKET       | -1 | Client, Server or UDP variable not a TCP/IP or UDP variable. |
| SOCKET_NO_CONNECT_TASK      | -2 | Could not create the connection task |
| SOCKET_NO_DNS_RESOLVE       | -3 | Could not resolve address |
| SOCKET_INVALID_PORT_NUMBER | -4 | Port not in range of 0-65535. |
| SOCKET_NOT_CONNECTED        | -5 | No connection has been established |
| SOCKET_STRING_TOO_SMALL     | -6 | Not enough room in string parameter to hold IP address. |

The available Direct Socket Functions are described as follows:

Language Constructs & Functions
Direct Socket Access
Direct Socket Access Functions Overview
Direct Socket Access Functions Overview

Access Direct Functions INTEGER Overview Part STRING STRUCTURE Socket


Direct Socket Access Functions Overview (Part 2)

|  |  |
|----|----|
| FUNCTION | DESCRIPTION |
| [SocketConnect] | The SocketConnect event is called when a connection is completed on a TCP_CLIENT or  TCP_SERVER variable. |
| [SocketDisconnect] | The SocketDisconnect event is called when a TCP_CLIENT or  TCP_SERVER socket is disconnected.   |
| [SocketReceive] | The SocketReceive event is called when a TCP_CLIENT or  TCP_SERVER socket receives data. |
| [SocketConnectClient] | This function initiates a connection on a TCP_CLIENT socket. |
| [SocketDisconnectClient] | This function disconnects a  TCP_CLIENT socket. |
| [SocketServerStartListen] | This function initiates listening on a TCP_ SERVER socket. |
| [SocketServerStopListen] | This function halts listening on a TCP_SERVER socket. |
| [SocketUDP_Enable] | This function enables the operation of an UDP_SOCKET. |
| [SocketUDP_Disable] | This function disables the operation of an UDP_SOCKET |
| [SocketSend] | This function transmits data on the SOCKET_STRUCT currently being used. SocketSend can be used by all three sockets; TCP_CLIENT, TCP_SERVER and UDP_SOCKET . |
| [SocketStatus] | The SocketStatus event is called when the status of a TCP_CLIENT or  TCP_SERVER socket changes. |
| [SocketGetStatus] | The SocketGetStatus event is called to retreive the exact status that triggers a SocketStatus event. |
| [SocketGetPortNumber] | This function returns the current port number for the given socket.  It is only valid for connected sockets. |
| [SocketGetRemoteIPAddress] | This function will return the IP Address of the remote device for a given connection or the IP address of a remote client connected to the given server variable. |
| [SocketGetAddressAsRequested] | This function will return the address parameter used for the SocketConnectClient() call or the SocketServerStartListenCall().  It is only valid for connected sockets. |
| [SocketIsBroadcast] | This function indicates whether the socket was configured with a broadcast address.  It is only valid for enabled UDP sockets.  This can be used to determine whether a new socket should be created if a unicast response is desired. |
| [SocketIsMulticast] | This function indicates whether the socket was configured with a mulitcast address.  It is only valid for enabled UDP sockets.  This can be used to determine whether a new socket should be created if a unicast response is desired. |
| [SocketGetSenderIPAddress] | This function returns the IP address of the sender of a UDP.  It is only valid for enabled UDP sockets.  It can only be used in the SOCKETRECEIVE event for a UDP_SOCKET.   |

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

Access Direct FUNCTION Functions Overview Part Socket SocketConnectClient SocketServerStartListenCall

|
| SOCKET_NOT_CONNECTED        | -5 | No connection has been established |
| SOCKET_STRING_TOO_SMALL     | -6 | Not enough room in string parameter to hold IP address. |

The available Direct Socket Functions are described as follows:


Direct Socket Access Functions Overview (Part 3)

  [SocketConnect]: SocketConnect.md
  [SocketDisconnect]: SocketDisconnect.md
  [SocketReceive]: SocketReceive.md
  [SocketConnectClient]: SocketConnectClient.md
  [SocketDisconnectClient]: SocketDisconnectClient.md
  [SocketServerStartListen]: SocketServerStartListen.md
  [SocketServerStopListen]: SocketServerStopListen.md
  [SocketUDP_Enable]: SocketUDP_Enable.md
  [SocketUDP_Disable]: SocketUDP_Disable.md
  [SocketSend]: SocketSend.md
  [SocketStatus]: SocketStatus.md
  [SocketGetStatus]: SocketGetStatus.md
  [SocketGetPortNumber]: SocketGetPortNumber.md
  [SocketGetRemoteIPAddress]: SocketGetRemoteIPAddress.md
  [SocketGetAddressAsRequested]: SocketGetAddressAsRequested.md
  [SocketIsBroadcast]: SocketIsBroadcast.md
  [SocketIsMulticast]: SocketIsMulticast.md
  [SocketGetSenderIPAddress]: SocketGetSenderIPAddress.md

Access Direct Functions Overview Part Socket SocketConnect SocketConnectClient SocketDisconnect SocketDisconnectClient SocketReceive SocketSend SocketServerStartListen SocketServerStopListen SocketUDP_Disable SocketUDP_Enable

SocketConnect SocketDisconnect SocketReceive SocketConnectClient SocketDisconnectClient SocketServerStartListen SocketServerStopListen SocketUDP_Enable SocketUDP_Disable SocketSend

It can only be used in the SOCKETRECEIVE event for a UDP_SOCKET. |

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later


Direct Socket Error Codes

# Direct Socket Error Codes

The error codes that can be returned by Direct Socket Access functions are listed in the following table.

|  |  |  |
|----|----|----|
| Keyword | Value | Connection Status |
| SOCKET_INVALID_SOCKET       | -1 | Client, Server or UDP variable not a TCP/IP or UDP variable. |
| SOCKET_NO_CONNECT_TASK      | -2 | Could not create the connection task |
| SOCKET_NO_DNS_RESOLVE       | -3 | Could not resolve address |
| SOCKET_INVALID_PORT_NUMBER | -4 | Port not in range of 0-65535. |
| SOCKET_NOT_CONNECTED        | -5 | No connection has been established |
| SOCKET_STRING_TOO_SMALL     | -6 | Not enough room in string parameter to hold IP address. |
| SOCKET_CLIENT_CONNECTED    | -7 | Connecting a client that is already connected. |
| SOCKET_CLIENT_CONNECT_IN_PROGRESS    | -8 | Trying to connect a client that is already attempting a connection. |
| SOCKET_ETHERNET_NOT_INITIALIZED    | -9 | Trying to connect a client when Ethernet is not fully initialized. |

Language Constructs & Functions
Direct Socket Access
Direct Socket Error Codes


SocketConnect

# SocketConnect

Name:

SocketConnect

Syntax:

    SOCKETCONNECT ClientVariable

    {

          // user code for routine

    }

NOTE:  ClientVariable used as an example. ServerVariable also applies.

Description:

This function is the event function called when a connection is completed on a TCP_CLIENT or  TCP_SERVER variable. The Status field of [SOCKET_STRUCT] holds the [returned values] indicating the status of the connection attempt.

(See also [THREADSAFE])

Parameters:

ClientVariable: the socket variable declared in the input/output section.

ServerVariable: the socket variable declared in the input/output section.

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [SOCKET_STRUCT]: Direct_Socket_Access_Functions_Overview.md
  [returned values]: javascript:void(0);
  [THREADSAFE]: ../Events/THREADSAFE.md
  [here]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketConnect


SocketConnectClient

# SocketConnectClient

Name:

SocketConnectClient

Syntax:

SIGNED_INTEGER SocketConnectClient(TCP_CLIENT ClientVariable,STRING Address, INTEGER Port, INTEGER Reconnect);

Description:

This function initiates a connection on a TCP_CLIENT socket.

Parameters:

ClientVariable: the socket variable declared in the input/output section.

Address: string variable containing the destination address; either as an IP address or as a name to be resolved into an address.

Port: number for the TCP client connection.

Reconnect: indicates whether the socket should reconnect automatically when disconnected from the remote end.

Return Value:

0: Success

\<0: Error

-1: ClientVariable is not a TCP/IP client variable.

-2: Could not create the connection task

-3: Port not in range of 0-65535.

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketConnectClient

INTEGER SIGNED_INTEGER STRING SocketConnectClient


SocketDisconnect:

# SocketDisconnect:

Name:

SocketDisconnect

Syntax:

    SOCKETDISCONNECT ClientVariable

    {

          // user code for routine

    }

NOTE:  ClientVariable used as an example. ServerVariable also applies.

Description:

The SocketDisconnect event is called when a TCP_CLIENT or  TCP_SERVER socket is disconnected.  The Status field of the [SOCKET_STRUCT] holds the [returned values] indicating the cause of the disconnection.

(See also [THREADSAFE])

Parameters:

ClientVariable: the socket variable declared in the input/output section.

ServerVariable: the socket variable declared in the input/output section.

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [SOCKET_STRUCT]: Direct_Socket_Access_Functions_Overview.md
  [returned values]: Status_Values.md
  [THREADSAFE]: ../Events/THREADSAFE.md
  [here]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketDisconnect
SocketDisconnect:

SOCKET_STRUCT SocketDisconnect THREADSAFE returned values

SOCKET_STRUCT
returned values
THREADSAFE


SocketDisconnectClient

# SocketDisconnectClient

Name:

SocketDisconnectClient

Syntax:

SIGNED_INTEGER SocketDisconnectClient (TCP_CLIENT ClientVariable);

Description:

This function disconnects a TCP_CLIENT socket.

Parameters:

ClientVariable: the socket variable declared in the input/output section.

Return Value:

0: Success

\<0: Error

-1: ClientVariable is not a TCP/IP client variable.

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketDisconnectClient


SocketGetAddressAsRequested

# SocketGetAddressAsRequested

Name:

SocketGetAddressAsRequested

NOTE: This topic covers the SocketGetAddressAsRequested function for TCP_CLIENT ClientVariable and  TCP_SERVER Server Variable.

Syntax:

SIGNED_INTEGER SocketGetAddressAsRequested (TCP_CLIENT ClientVariable, STRING Address);

SIGNED_INTEGER SocketGetAddressAsRequested (TCP_SERVER ServerVariable, STRING Address);

Description:

This function will return the address parameter used for the SocketConnectClient() call or the SocketServerStartListenCall().  It is only valid for connected sockets.

Parameters:

For TCP_CLIENT ClientVariable:

ClientVariable: the socket variable declared in the input/output section.

Address: String variable into which the address is placed.

For TCP_SERVER ServerVariable:

ServerVariable: the socket variable declared in the input/output section.

Address: String variable into which the address is placed.

Return Value:

0: Success

\<0: Error

-1: ClientVariable is not a TCP client variable (TCP_CLIENT ClientVariable).

-1: ServerVariable is not a TCP server variable. (TCP_SERVER ServerVariable).

-5: No connection has been established

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketGetAddressAsRequested

SIGNED_INTEGER STRING SocketConnectClient SocketGetAddressAsRequested SocketServerStartListenCall


SocketGetPortNumber

# SocketGetPortNumber

Name:

SocketGetPortNumber

NOTE: This topic covers the SocketGetPortNumber function for TCP_CLIENT ClientVariable, TCP_SERVER Server Variable and UDP_SOCKET UDP_Variable.

Syntax:

SIGNED_LONG_INTEGER SocketGetPortNumber(TCP_CLIENT ClientVariable);

SIGNED_ LONG_INTEGER SocketGetPortNumber(TCP_SERVER ServerVariable);

SIGNED_ LONG_INTEGER SocketGetPortNumber(UDP_SOCKET UDP_Variable);

Description:

This function will return the current port number for the given socket.  It is only valid for connected sockets.

Parameters:

ClientVariable: the socket variable declared in the input/output section (TCP_CLIENT socket).

ServerVariable: the socket variable declared in the input/output section (TCP_SERVER socket).

UDP_Variable: the socket variable declared in the input/output section (UDP_SOCKET socket).

TxString: String variable containing the data to transmit.

Return Value:

\>=0: The port number of the current connection.

\<0: Error

-1: ClientVariable is not a TCP/IP client variable (TCP_CLIENT socket).

-1: ServerVariable is not a TCP server variable (TCP_SERVER socket).

-1: UDP_Variable is not a UDP variable (UDP_SOCKET socket).

-5: No connection has been established

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketGetPortNumber


SocketGetRemoteIPAddress

# SocketGetRemoteIPAddress

Name:

SocketGetRemoteIPAddress

NOTE: This topic covers the SocketGetRemoteIPAddress function for TCP_CLIENT ClientVariable and  TCP_SERVER Server Variable.

Syntax:

SIGNED_INTEGER SocketGetRemoteIPAddress (TCP_CLIENT ClientVariable, STRING Address);

SIGNED_INTEGER SocketGetRemoteIPAddress (TCP_SERVER ServerVariable, STRING Address);

Description:

This function will return the IP Address of the remote device for a given connection or the IP address of a remote client connected to the given server variable.

Parameters:

For TCP_CLIENT ClientVariable:

ClientVariable: the socket variable declared in the input/output section.

Address: String variable into which the address is placed.  The format is the standard dot-decimal notation.

For TCP_SERVER ServerVariable:

ServerVariable: the socket variable declared in the input/output section.

Address: String variable into which the address is placed.

Return Value:

0: The Address parameter contains the remote address

\<0: Error

-1: ClientVariable is not a TCP client variable (TCP_CLIENT ClientVariable).

-1: ServerVariable is not a TCP server variable. (TCP_SERVER ServerVariable).

-5: No connection has been established

-6: Not enough room in string parameter to hold IP address.

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketGetRemoteIPAddress


SocketGetSenderIPAddress

# SocketGetSenderIPAddress

Name:

SocketGetSenderIPAddress

Syntax:

SIGNED_INTEGER SocketGetSenderIPAddress (UDP_SOCKET UDP_Variable, STRING Address);

Description:

This function returns the IP address of the sender of a UDP.  It is only valid for enabled UDP sockets.  It can only be used in the SOCKETRECEIVE event for a UDP_SOCKET.

Parameters:

UDP_Variable: the socket variable declared in the input/output section

Address: String variable into which the address is placed.

Return Value:

0: Success.

\<0: Error

-1: UDP_Variable is not a UDP socket variable.

-5: No connection has been established

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketGetSenderIPAddress


SocketGetStatus

# SocketGetStatus

Name:

SocketGetStatus

Syntax:

   SIGNED_INTEGER SocketGetStatus();

Description:

This function is only valid within the SocketStatus event.  The reason this call is needed is to retrieve the exact status that triggered the SocketStatus event.  The status of a socket can change very quickly and if the field in the socket structure is used, interim values could be missed because the code in the SocketStatus routine does not get a chance to run before the structure’s status field changes.  An example of this is when a server socket gets disconnected remotely.  The status will change from connected to disconnected remotely to waiting.  The SocketStatus event will be triggered each time but the status field of the structure may only read waiting even in the broken remotely event.

Parameters:

None

Return Value:

The status of the socket when the event was generated.

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketGetStatus


SocketIsBroadcast

# SocketIsBroadcast

Name:

SocketIsBroadcast

Syntax:

SIGNED_INTEGER SocketIsBroadcast (UDP_SOCKET UDP_Variable);

Description:

This function indicates whether the socket was configured with a broadcast address.  It is only valid for enabled UDP sockets.  This can be used to determine whether a new socket should be created if a unicast response is desired.

Parameters:

UDP_Variable: the socket variable declared in the input/output section

Return Value:

0: The UDP variable is not in a broadcast configuration.

1: The UDP variable is in a broadcast configuration

\<0: Error

-1:UDP_Variable is not a UDP socket variable.

-5: No connection has been established

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketIsBroadcast


SocketIsMulticast

# SocketIsMulticast

Name:

SocketIsMulticast

Syntax:

SIGNED_INTEGER SocketIsMulticast (UDP_SOCKET UDP_Variable);

Description:

This function indicates whether the socket was configured with a mulitcast address.  It is only valid for enabled UDP sockets.  This can be used to determine whether a new socket should be created if a unicast response is desired.

Parameters:

UDP_Variable: the socket variable declared in the input/output section

Return Value:

0: The UDP variable is not in a multicast configuration.

1: The UDP variable is in a multicast configuration

\<0: Error

-1: UDP_Variable is not a UDP socket variable.

-5: No connection has been established

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketIsMulticast


SocketReceive

# SocketReceive

Name:

SocketReceive

Syntax:

    SocketReceive ClientVariable

    {

          // user code for routine

// make sure that the buffer is empty so we can receive new data   ClearBuffer(UDP_Variable.SocketRxBuf);

    }

NOTE:  ClientVariable used as an example. ServerVariable and UDP_Variable also apply.

Description:

The RECEIVE event is called when a TCP_CLIENT,  TCP_SERVER or UDP_SOCKET socket receives data.  The Rx$ field of the [SOCKET_STRUCT] contains the data.

(See also [THREADSAFE])

NOTE:  The RECEIVE event is comparable to a CHANGE event on the Rx$ field of the socket structure.

NOTE: Due to the nature of UDP traffic, each UDP datagram must be processed before the next can be received. For SIMPL+, this means that the buffer must be emptied before the next packet can be received. Please use the ClearBuffer() SIMPL+ routine for this.

Parameters:

ClientVariable: the socket variable declared in the input/output section.

ServerVariable: the socket variable declared in the input/output section.

UDP_Variable: the socket variable declared in the input/output section

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [SOCKET_STRUCT]: Direct_Socket_Access_Functions_Overview.md
  [THREADSAFE]: ../Events/THREADSAFE.md
  [here]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketReceive

CHANGE ClearBuffer SOCKET_STRUCT SocketReceive THREADSAFE


SocketSend

# SocketSend

Name:

SocketSend

NOTE: This topic covers the SocketGetPortNumber function for TCP_CLIENT ClientVariable, TCP_SERVER Server Variable and UDP_SOCKET UDP_Variable.

Syntax:

SIGNED_INTEGER SocketSend(TCP_CLIENT ClientVariable, STRING TxString);

Description:

This function transmits data on the SOCKET_STRUCT currently being used. SocketSend can be used by all three sockets; TCP_CLIENT, TCP_SERVER and UDP_SOCKET.

Parameters:

ClientVariable: the socket variable declared in the input/output section (TCP_CLIENT socket).

ServerVariable: the socket variable declared in the input/output section (TCP_SERVER socket).

UDP_Variable: the socket variable declared in the input/output section (UDP_SOCKET socket).

TxString: String variable containing the data to transmit.

Return Value:

\>=0: Success with number of bytes sent (2-series processors)

=0: Success (3-series processors)

\<0: Error

-1: ClientVariable is not a TCP/IP client variable (TCP_CLIENT socket).

-1: ServerVariable is not a TCP server variable (TCP_SERVER socket).

-1: UDP_Variable is not a UDP variable (UDP_SOCKET socket).

-5: No connection has been established

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketSend

SIGNED_INTEGER STRING SocketSend Success


SocketServerStartListen

# SocketServerStartListen

Name:

SocketServerStartListen

Syntax:

SIGNED_INTEGER SocketServerStartListen(TCP_SERVER ServerVariable, STRING Address, INTEGER port);

Description:

This function initiates listening on a TCP_SERVER socket.

Parameters:

ServerVariable: the socket variable declared in the input/output section.

Address: string variable containing the remote address; either as an IP address or as a name to be resolved into an address.  If non-zero, connections are only allowed from the address matching the string.

Port: number for the TCP server connection.

Return Value:

0: Success

\<0: Error

-1: ServerVariable is not a TCP/IP server variable.

-4: Port not in range of 0-65535

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketServerStartListen

INTEGER SIGNED_INTEGER STRING SocketServerStartListen


SocketServerStopListen

# SocketServerStopListen

Name:

SocketServerStopListen

Syntax:

SIGNED_INTEGER SocketServerStopListen (TCP_SERVER ServerVariable);

Description:

This function halts listening on a TCP_ SERVER socket.

Parameters:

ServerVariable: the socket variable declared in the input/output section.

Return Value:

0: Success

\<0: Error

-1: ServerVariable is not a TCP/IP server variable.

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketServerStopListen


SocketStatus

# SocketStatus

Name:

SocketStatus

Syntax:

    SOCKETSTATUS ClientVariable

    {

SIGNED_INTEGER Status;

          // user code for routine

Status = SocketGetStatus();

    }

NOTE:  ClientVariable used as an example. ServerVariable also applies.

Description:

The STATUS event is called when the status of a TCP_CLIENT or  TCP_SERVER socket changes.  Use the SocketGetStatus() routine to retrieve the current status (see [SocketGetStatus]). The Status field of the [SOCKET_STRUCT] holds the [returned values] indicating the current status.

NOTE:  The STATUS event is comparable to a CHANGE event on the Status field of the socket structure.

(See also [THREADSAFE])

Parameters:

ClientVariable: the socket variable declared in the input/output section.

ServerVariable: the socket variable declared in the input/output section.

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [SocketGetStatus]: javascript:void(0);
  [SOCKET_STRUCT]: Direct_Socket_Access_Functions_Overview.md
  [returned values]: Status_Values.md
  [THREADSAFE]: ../Events/THREADSAFE.md
  [here]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketStatus

CHANGE SIGNED_INTEGER SOCKET_STRUCT SocketGetStatus SocketStatus THREADSAFE returned values


SocketUDP_Disable

# SocketUDP_Disable

Name:

SocketUDP_Disable

Syntax:

SIGNED_INTEGER SocketUDP_Disable(UDP_SOCKET UDP_Variable);

Description:

This function disables the operation of an UDP_SOCKET.

Parameters:

UDP_Variable: the socket variable declared in the input/output section.

Return Value:

0: Success

\<0: Error

-1: UDP_Variable is not a UDP variable.

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketUDP Disable
SocketUDP_Disable


SocketUDP_Enable

# SocketUDP_Enable

Name:

SocketUDP_Enable

Syntax:

SIGNED_INTEGER SocketUDP_Enable(UDP_SOCKET UDP_Variable, STRING address,  INTEGER port);

Description:

This function enables the operation of an UDP_SOCKET.

Parameters:

UDP_Variable: the socket variable declared in the input/output section.

Address: string variable containing the remote address; either as an IP address or as a name to be resolved into an address

Port: port number to use for communications.

Return Value:

0: Success

\<0: Error

-1: UDP_Variable is not a UDP variable.

-3: Could not resolve address

-4: Port not in range of 0-65535.

NOTE: Return values that are negative numbers are errors. More information on error codes for Direct Socket functions can be found [here].

Example:

In the case of Direct Socket Access Functions and events, the example code is best when viewed in the context in which it applies. For that reason, the example code for this event can be viewed by clicking [here][1]. A scrolling pop up will open for your convenience.

Version:

SIMPL Version 2.10.00 or later

SIMPL+ Version 3.03.00 or later

  [here]: javascript:void(0);
  [1]: javascript:void(0);

Language Constructs & Functions
Direct Socket Access
SocketUDP Enable
SocketUDP_Enable


Status Values

# Status Values

The returned Status values of TCP_CLIENT, TCP_SERVER, and UDP_SOCKET  connections can be found in the following table.

|                               |       |                            |
|-------------------------------|-------|----------------------------|
| Keyword                       | Value | Connection Status          |
| SOCKET_STATUS_NO_CONNECT      | 0     | Not Connected              |
| SOCKET_STATUS_WAITING         | 1     | Waiting for Connection     |
| SOCKET_STATUS_CONNECTED       | 2     | Connected                  |
| SOCKET_STATUS_CONNECT_FAILED  | 3     | Connection Failed          |
| SOCKET_STATUS_BROKEN_REMOTELY | 4     | Connection Broken Remotely |
| SOCKET_STATUS_BROKEN_LOCALLY  | 5     | Connection Broken Locally  |
| SOCKET_STATUS_DNS_LOOKUP      | 6     | Performing DNS Lookup      |
| SOCKET_STATUS_DNS_FAILED      | 7     | DNS Lookup Failed          |
| SOCKET_STATUS_DNS_RESOLVED    | 8     | DNS Name Resolved          |

Language Constructs & Functions
Direct Socket Access
Status Values


Email Function Return Error Codes (Part 1)

# Email Function Return Error Codes

Language Constructs & Functions
Email Functions
Email Function Return Error Codes
Email Function Return Error Codes


Email Function Return Error Codes (Part 2)

| SMTP_OK                              | 0           | Success                                                                                |
| ------------------------------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------- |
| SMTP ERRORS (NON-RECOVERABLE ERRORS) |             |                                                                                |
| Error                                | Description |                                                                                |
| SMTP_ERROR_FATAL                     | -1          | Any non-recoverable error from the e-mail module of the firmware (for example: if “mailserver”, “from” and “to” are empty). |
| SMTP_ERROR_ILLEGAL_CMD               | -2          | General internal error.                                                                                |
| SMTP_ERROR_CONNECT                   | -3          | Failure to connect to the mailserver.                                                                                |
| SMTP_ERROR_SEND                      | -4          | Internal error while actually sending out e-mail.                                                                           |
| SMTP_ERROR_RECV                      | -5          | Internal error while actually receiving out e-mail.                                                                         |
| SMTP_ERROR_NU_CONNECT                | -6          | Internal error while processing the send.                                                                                |
| SMTP_ERROR_NU_BUFFERS                | -7          | Lack of memory buffers while processing send or receive mail. Internal error.                                               |
| SMTP_ERROR_AUTHENTICATION            | -8          | Authentication failure.                                                                                |
| SMTP_ERROR_AUTH_LOGIN_UNSUPPORTED    | -9          | CLEAR TEXT login scheme is not supported.                                                                                |
| SMTP_INV_PARAM                       | -10         | Bad parameters to SendMail. Must supply Server, From, and To.                                                               |
| SMTP_ETHER_NOT_ENABLED               | -11         | Ethernet not enabled. Cannot send mail.                                                                                |
| SMTP_NO_SERVER_ADDRESS               | -12         | No DNS servers configured. Cannot resolve name.                                                                             |
| SMTP_SEND_FAILURE                    | -13         | SendMail failed.                                                                                |
| SMTP FAILURES (RECOVERABLE ERRORS)   |             |                                                                                |
| Error                                | Description |                                                                                |
| IDS_SMTP_FAILURE_MAIL_COMMAND        | 2           | There was an error sending e-mail with the "from" recipient.                                                                |
| SMTP_FAILURE_TO_RCPT_COMMAND         | 3           | There was an error sending e-mail to the “to” recipient.                                                                    |
| SMTP_FAILURE_CC_RCPT_COMMAND         | 4           | There was an error sending e-mail to the “CC” recipient.                                                                    |
| SMTP_FAILURE_DATA_COMMAND            | 5           | There was an error sending the message body.                                                                                |
| SMTP_FAILURE_ATTACHMENT_OPEN         | 6           | Unable to open attachment file                                                                                |

Codes ERRORS Email Error FAILURES Function Part Return


Email Function Return Error Codes (Part 3)

[Related Topics Link IconRelated Topics]

  [Related Topics Link IconRelated Topics]: javascript:mc1.Click()

Click Codes Email Error Function Part Return

|
| SMTP_FAILURE_DATA_COMMAND            | 5           | There was an error sending the message body. |
| SMTP_FAILURE_ATTACHMENT_OPEN         | 6           | Unable to open attachment file                                                                                |


Important SendMail Considerations

# Important SendMail Considerations

1.  In the SIMPL+ function call to "Send Mail", the parameters "Mailserv", "To" and "From" fields are MANDATORY, whereas "cc", "subject" and "message" are not.

2.  Only the "SMTP AUTH" authentication type with "LOGIN" authentication scheme is supported for now.

3.  Questions for the ISP/e-mail service provider to determine compatibility with the SEND MAIL feature.\

- Does the ISP/service provider support NON-WEB clients?

- Does the ISP/service provider support "SMTP AUTH" authentication type with "LOGIN" authentication scheme?

- For example: the e-mail provider SBC YAHOO supports web as well as non web clients. For non web clients, one of the mail servers to communicate with is SMTPAUTH.FLASH.NET. This mail server supports SMTP AUTH and LOGIN auth scheme.

4.  SEND MAIL client queries the mail server to determine the authentication type and scheme and returns an "unsupported" error (error # -9) if the mail-server does not support LOGIN scheme; however if the client is unable to determine information regarding the schemes supported, it will go ahead and try to send out the e-mail to the intended recipients, but the server may refuse to relay it to external destinations. This will return a "failure" code. (Refer to [Email Function Return Error Codes] )

5.  For mail servers needing no authentication, the "username" and "password" field are set to an EMPTY STRING (""). Again, as in (4) above there is no guarantee that the mail-server will relay the e-mail to external destinations.

6.  In case of an error/failure, the first occurring error/failure code is returned.

7.  If the message line exceeds 998 characters without a \<CR-LF\> sequence, the SEND MAIL module automatically inserts one.

8.  The "Mail-server" parameter in the SIMPL+ function call to Send Mail can be an IP address, ex. "132.149.6.220" or a name "mail1.Mycompanyname.com". In case of a name, DNS will be used to resolve the name, and the control system must have a DNS server set up.

9.  REMINDER: Strings in SIMPL+ can only be 256 characters long. But internal to SIMPL+ they can be concatenated to a total length of 65536 characters, as long as a SIMPL+ BUFFER_INPUT type is used to accumulate the strings.

  [Email Function Return Error Codes]: Email_Function_Return_Error_Codes.md

Language Constructs & Functions
Email Functions
Important SendMail Considerations

BUFFER_INPUT Codes Considerations Email Error Function Important Return STRING SendMail