#CRESTRON_SIMPLSHARP_LIBRARY

# #CRESTRON_SIMPLSHARP_LIBRARY

Name:

#CRESTRON_SIMPLSHARP_LIBRARY

Syntax:

    #CRESTRON_SIMPLSHARP_LIBRARY "\<SIMPL# Library Name\>"

Description:

Directs the compiler to include code from a Crestron SIMPL# library. The module name specified is the library filename without the CLZ extension.

Example:

    #CRESTRON_SIMPLSHARP_LIBRARY "MyCrestronLibrary"

Directs the compiler to include the Crestron SIMPL# Library, "MyCrestronLibrary.clz".

Version:

3-Series

SIMPL v4.02.00 and later

4-Series

SIMPL v4.14.06 and later

Language Constructs & Functions
Compiler Directives
CRESTRON SIMPLSHARP LIBRARY
#CRESTRON_SIMPLSHARP_LIBRARY


#DEFAULT_NONVOLATILE

# #DEFAULT_NONVOLATILE

Name:

#DEFAULT_NONVOLATILE

Syntax:

    #DEFAULT_NONVOLATILE

Description:

Program variables retain their value if hardware power is lost. The compiler will default all variables declared within the SIMPL+ module as nonvolatile. Individual variables can use the Volatile keyword to override this default. See also: [#DEFAULT_VOLATILE].

Example:

    #DEFAULT_NONVOLATILE

Version:

X Generation:  Not Supported.  On X Generation Systems, all global variables are Non Volatile.

2-Series:  SIMPL v2.01.05 and later

  [#DEFAULT_VOLATILE]: _DEFAULT_VOLATILE.md

Language Constructs & Functions
Compiler Directives
DEFAULT NONVOLATILE
#DEFAULT_NONVOLATILE


#DEFAULT_VOLATILE

# #DEFAULT_VOLATILE

Name:

#DEFAULT_VOLATILE

Syntax:

    #DEFAULT_VOLATILE

Description:

Program variables will not retain their value if hardware power is lost. The compiler will default all variables declared within the SIMPL+ module as volatile. Individual variables can use the Nonvolatile keyword to override this default. See also [#DEFAULT_NONVOLATILE.]

Example:

    #DEFAULT_VOLATILE

Version:

X Generation:  Not Supported.  On X Generation Systems, all global variables are Non Volatile.

2-Series:  SIMPL v2.01.05 and later

  [#DEFAULT_NONVOLATILE.]: _DEFAULT_NONVOLATILE.md

Language Constructs & Functions
Compiler Directives
DEFAULT VOLATILE
#DEFAULT_VOLATILE


#DEFINE_CONSTANT

# #DEFINE_CONSTANT

Name:

#DEFINE_CONSTANT

Syntax:

    #DEFINE_CONSTANT \<constant_name\> \<constant_value\>

Description:

Define a \<constant_value\> that will be substituted anywhere in the current source file where \<constant_name\> is used.

Example:

    #DEFINE_CONSTANT ETX 0x03

    INTEGER I;

    I=ETX;

Assigns the value of 0x03 to the variable I.

Version:

X Generation:  SIMPL v1.20.01 and later

2-Series:  SIMPL v2.01.05 and later

Language Constructs & Functions
Compiler Directives
DEFINE CONSTANT
#DEFINE_CONSTANT


#DIGITAL_EXPAND

# #DIGITAL_EXPAND

Name:

#DIGITAL_EXPAND

Syntax:

    #DIGITAL_EXPAND \<value\>

Description:

This provides a way to expand, or add, inputs and/or outputs for a specified symbol. It is useful when you want to expand the number of outputs for a given input, expand the number of inputs for a specific output, expand both the inputs and outputs or for a variety of other combinations.

NOTE: Expansion directives can only be used in conjunction with an array input.

Values:

|  |  |
|----|----|
| Value | Description |
| Separately | This is the default value and allows for expansion of both inputs and outputs, in no particular order, on a given symbol. |
| OutputsWithParams | This allows a single input to be expanded into a number of outputs. |
| InputsWithOutputs | This allows the combined expansion of inputs and outputs. If you add an input, an output is also automatically added. |
| InputsWithParams | This allows the expansion of the number of inputs for a single output. |
| AllWithAny | This allows for the expansion of both inputs and outputs, but unlike InputWithOutputs, the relationship between inputs and outputs doesn't have to be one to one. |
| PWithIxorO | This allows for the expansion of either inputs or outputs. |

Example:

    #DIGITAL_EXPAND OutputsWithParameters InputsWithOutputs

A single input would be expanded into a specified number of outputs.

Version:

SIMPL+ Version 2.10.00 or later

Control System:

2-Series Only

Language Constructs & Functions
Compiler Directives
DIGITAL EXPAND
#DIGITAL_EXPAND


#ENABLE_DYNAMIC

# #ENABLE_DYNAMIC

Name:

#ENABLE_DYNAMIC

Syntax:

#ENABLE_DYNAMIC

Description:

Required if the DYNAMIC keyword is used on variable definitions.   If DYNAMIC variables are not declared, this compiler directive can still be beneficial to use.  It will allow the compiler & runtime to make better use of memory by dynamically allocating internal temporary variables.

Example:

#ENABLE_DYNAMIC

Version:

X Generation:  Not supported

2-Series:  SIMPL v2.10.24 and later (Requires CUZ 4.000 or later)

Language Constructs & Functions
Compiler Directives
ENABLE DYNAMIC
#ENABLE_DYNAMIC


#ENABLE_STACK_CHECKING

# #ENABLE_STACK_CHECKING

Name:

#ENABLE_STACK_CHECKING

Syntax:

#ENABLE_STACK_CHECKING

Description:

Allow run-time stack checking to be performed on this  module.  If there is a stack overflow, you will see an error similar to:

Module S-5 : ExampleSimpl+Code.umc at line 25: Stack overflow. Terminating Task. (space =xxxx)

When a function is called, it adds memory to the stack. When the function returns, the memory is removed from the stack. However, if you have a recursive program or if inputs come in faster than they can be processed (i.e. the PUSH/CHANGE/EVENT function is called but does not finish and return), the stack may continue to grow. This option checks for a stack whose memory grows beyond that which is allocated. The default memory allocation is 4k.

Refer to [#Large_Stack] to increase the stack size.

NOTE: #ENABLE_STACK_CHECKING must be defined before all User-Defined functions are declared.

Example:

#ENABLE_STACK_CHECKING

Version:

X Generation:  Not supported

2-Series:  SIMPL v2.05.17 and later (Requires CUZ 3.080 or later).

  [#Large_Stack]: _LARGE_STACK.md

Language Constructs & Functions
Compiler Directives
ENABLE STACK CHECKING
#ENABLE_STACK_CHECKING


#ENABLE_TRACE

# #ENABLE_TRACE

Name:

#ENABLE_TRACE

Syntax:

#ENABLE_TRACE

Description:

When invoked, this enables trace output. If it is not invoked no console output will be generated. Analogous to a debug mode when on, and a release mode when off. When #ENABLE_TRACE is "on" Trace statements are shown as Trace. When "off" Trace statements are not shown.

NOTE: Shown as trace indicates formatting with special characters and seen in SIMPL Debugger Trace window as Trace Data.

Version:

X Generation:  Not supported

2-Series:  SIMPL v2.10.09 and later

Language Constructs & Functions
Compiler Directives
ENABLE TRACE
#ENABLE_TRACE


#HELP

# #HELP

Name:

#HELP

Syntax:

    #HELP "\<help text\>"

Description:

Several #HELP lines can be specified. When F1 is hit either on the symbol in the Symbol Library, in either the Program View or the Detail view, the help text will be displayed. If this directive or the #HELP_BEGIN … #HELP_END directive is not present, the help text shown is "NO HELP AVAILABLE". Note that it is preferable to use the #HELP_BEGIN … #HELP_END directives rather than #HELP since it is easier to edit and read the code.

Example:

    #HELP "This is line 1 of my help text"

    #HELP "This is line 2 of my help text"

Version:

X Generation:  SIMPL v1.20.01 and later

2-Series:  SIMPL v2.01.05 and later

Language Constructs & Functions
Compiler Directives
HELP
#HELP


#HELP_BEGIN … #HELP_END

# #HELP_BEGIN … #HELP_END

Name:

#HELP_BEGIN … #HELP_END

Syntax:

    #HELP_BEGIN

    Help Text Line 1

    Help Text Line 2

    etc.

    #HELP_END

Description:

The #HELP_BEGIN, #HELP_END pair makes it easier to create help since each line does not need a separate #HELP directive. When F1 is hit either on the symbol in the Symbol Library, in either the Program View or the Detail view, the help text will be displayed. If this directive or #HELP is not present, the help text shown is "NO HELP AVAILABLE". Note that the text will show up exactly as typed between the begin/end directives (including blank lines).

Example:

    #HELP_BEGIN

    This is help line 1.

    This is help line 3.

    #HELP_END

Version:

X Generation:  SIMPL v1.20.01 and later

2-Series:  SIMPL v2.01.05 and later

Language Constructs & Functions
Compiler Directives
HELP BEGIN …  HELP END
#HELP_BEGIN … #HELP_END


#HINT

# #HINT

Name:

#HINT

Syntax:

    #HINT "Hint Text"

Description:

The #HINT shows up in the status bar and provides a short tactical clue as to the function of the symbol in the same way that Crestron-defined built-in symbols do. If the hint is specified, it will be visible when the symbol is highlighted in the User Modules section of the Symbol Library. The text shows up as the symbol name as it is stored on disk, followed by a colon, followed by the text. For example, a symbol with the name "My Symbol" might be stored on disk with the filename MYSYM.USP. If the hint is specified as #HINT "This is my symbol!" then the status bar will show "MYSYM.USP : This is my symbol!". If no #HINT is specified, then only the filename is shown.

Example:

    #HINT "This module controls a CNX-PAD8 Switcher"

Version:

X Generation:  SIMPL v1.20.01 and later

2-Series:  SIMPL v2.01.05 and later

Language Constructs & Functions
Compiler Directives
HINT
#HINT


#IF_DEFINED … #ENDIF

# #IF_DEFINED … #ENDIF

Name:

#IF_DEFINED … #ENDIF

Syntax:

    #IF_DEFINED \<constant_name\>

    \<code\>

    #ENDIF

Description:

Results in compilation of the \<code\> only if \<constant_name\> has previously been defined. This construct is generally useful for putting in code for debugging purposes, giving the ability to easily turn the debugging on and off during compilation.

Example:

    #DEFINE_CONSTANT DEBUG 1

    DIGITAL_OUTPUT OUT$;

    INTEGER I;

    FOR(I=0 to 20)

    {

      #IF_DEFINED DEBUG

        PRINT("Loop index I = %d\n", I);

      #ENDIF

      OUT$ = ITOA(I);

    }

The value of the loop is printed only if the DEBUG constant is defined. In order to prevent compilation of the code, delete the line that defines the constant or comment it out.

Version:

X Generation:  SIMPL v1.50.06

2-Series:  SIMPL v2.01.05 and later

See also [IsSignalDefined]

  [IsSignalDefined]: ../System_Interfacing/IsSignalDefined.md

Language Constructs & Functions
Compiler Directives
IF DEFINED …  ENDIF
#IF_DEFINED … #ENDIF

DEFINE_CONSTANT DIGITAL_OUTPUT ENDIF FOR IF_DEFINED INTEGER ITOA IsSignalDefined PRINT


#IF_NOT_DEFINED … #ENDIF

# #IF_NOT_DEFINED … #ENDIF

Name:

#IF_NOT_DEFINED … #ENDIF

Syntax:

    #IF_NOT_DEFINED \<constant_name\>

    \<code\>

    #ENDIF

Description:

Results in compilation of the \<code\> only if \<constant_name\> has not been  previously defined. This construct is generally useful for putting in code for debugging purposes, giving the ability to easily turn the debugging on and off during compilation.

Example:

    #DEFINE_CONSTANT DEBUG 1

    DIGITAL_OUTPUT OUT$;

    INTEGER I;

    FOR(I=0 to 20)

    {

      #IF_DEFINED DEBUG

        PRINT("Loop index I = %d\n", I);

      #ENDIF

      #IF_NOT_DEFINED_DEBUG

        OUT$ = ITOA(I);

      #ENDIF

    }

The value of the loop is only printed if the DEBUG constant is defined. The output OUT$ is only generated if the debug constant is not defined (if debug mode is not turned on). In order to generate "release" code, the debug constant can be deleted or commented out.

Version:

X Generation:  SIMPL v1.50.06

2-Series:  SIMPL v2.01.05 and later

Language Constructs & Functions
Compiler Directives
IF NOT DEFINED …  ENDIF
#IF_NOT_DEFINED … #ENDIF


#INCLUDEPATH

# #INCLUDEPATH

Name:

#INCLUDEPATH

Syntax:

    #INCLUDEPATH "\<absolute_path or relative_path\>"

Description:

Directs the compiler to search for User SIMPL+ and SIMPL# Libraries in the specified paths.

The compiler will search for the library in the following order:

   1)  Project Folder

   2)  Global SIMPL+ Folder (refer to Edit | Preferences | Paths in SIMPL).

   3)  Paths specified in #INCLUDEPATH compiler directive

Example:

#INCLUDEPATH "c:\\MyLibrares"

#INCLUDEPATH "..\\..\\Projects\\bin"

      #USER_LIBRARY "MySPlusLibrary"

      #USER_SIMPLSHARP_LIBRARY "MySSharpLibrary"

Version:

3-Series

SIMPL v4.02.17 and later

Language Constructs & Functions
Compiler Directives
INCLUDEPATH
#INCLUDEPATH


#LARGE_STACK

# #LARGE_STACK

Name:

#LARGE_STACK

Syntax:

#LARGE_STACK

Description:

Increase the stack size.  Usually the default stack size is sufficient, unless heavy recursion is being done.  If you see an error similar to:

Module S-5 : foobar.umc at line 25: Stack overflow. Terminating Task. (space =xxxx)

You can try using the #LARGE_STACK directive, which increases the stack size to 8k.  If this does not help, the module should be checked for heavy recursion.  See [#Enable_Stack_Checking] to allow run-time stack checking to be performed on this module.

In functions, only INTEGER declarations (not strings, string arrays, or integer arrays) are taken from the stack.

NOTE: #LARGE_STACK must be defined before all User-Defined functions are declared.

Example:

#LARGE_STACK

Version:

X Generation:  Not supported

2-Series:  SIMPL v2.05.17 and later (Requires CUZ 3.080 or later)

  [#Enable_Stack_Checking]: _ENABLE_STACK_CHECKING.md

Language Constructs & Functions
Compiler Directives
LARGE STACK
#LARGE_STACK


#MAX_INTERNAL_BUFFER_SIZE

# #MAX_INTERNAL_BUFFER_SIZE

Name:

#MAX_INTERNAL_BUFFER_SIZE

Syntax:

#MAX_INTERNAL_BUFFER_SIZE \<size\>

Description:

2-Series only.  Sets the maximum size in bytes for the compiler’s internal string allocations.  By default, the compiler will allocate 65535 bytes when using STRING_OUTPUT variables.  String arguments passed to User Functions may also result in a 65535 byte string allocation, depending the argument’s usage.   #MAX_INTERNAL_BUFFER_SIZE can be used to specify a different upper allocation limit.  The range can be from 1-65535.

NOTE:  There are some conditions where this compiler directive can be useful:\
\
This compiler directive can be used to optimize the amount of memory used by a module.  Strings such as STRING_OUTPUTs and function arguments have unknown values, forcing the compiler to allocate the maximum buffer length of 65535 bytes.  If the approximate length is known for these types of variables, then this compiler directive can be used to specify a smaller amount.  \
\
Due to some compiler optimizations that Crestron has chosen to implement, the use of some strings may result in a runtime string buffer overflow.  This error might result in the following message, “String __FN_DST_STR__ overflow.”  Setting this compiler directive will replace the compiler’s assumed number of bytes with the number of bytes specified by the directive.\
\
This compiler directive is also useful for large modules and/or when many instances of a module are running simultaneously on the control system.

Example:

#MAX_INTERNAL_BUFFER_SIZE 10000

Version:

X Generation:  Not supported

2-Series:  SIMPL v3.01.25 or later

3-Series:  N/A

Language Constructs & Functions
Compiler Directives
MAX INTERNAL BUFFER SIZE
#MAX_INTERNAL_BUFFER_SIZE


#OUTPUT_SHIFT

# #OUTPUT_SHIFT

Name:

#OUTPUT_SHIFT

Syntax:

    #OUTPUT_SHIFT \<value\>

Description:

This provides a way to arrange the inputs and outputs on the symbol graphic so that they line up and are easy to read.

Example:

    #OUTPUT_SHIFT 5

This would shift the outputs on a given symbol by five places.

Version:

SIMPL+ Version 2.10.00 or later

Control System:

2 Series Only, CUZ 4.00 or later

Language Constructs & Functions
Compiler Directives
OUTPUT SHIFT
#OUTPUT_SHIFT


#PRINT_TO_TRACE

# #PRINT_TO_TRACE

Name:

#PRINT_TO_TRACE

Syntax:

#PRINT_TO_TRACE

Description:

When invoked, this converts all print statements to trace statements. Intended to be a quick way to convert all [Print] functions to the new [Trace] function. When #PRINT_TO_TRACE is "on" Print statements are shown as Trace. When "off" Print statements are shown as Console data.

NOTE: Shown as console data indicates no additional formatting and may be seen in the Trace window as Console data.

Version:

X Generation:  Not supported

2-Series:  SIMPL v2.10.09 and later

  [Print]: ../String_Formatting_&_Printing_Functions/PRINT.md
  [Trace]: ../String_Formatting_&_Printing_Functions/TRACE.md

Language Constructs & Functions
Compiler Directives
PRINT TO TRACE
#PRINT_TO_TRACE


_SKIP_

# _SKIP_

This allows a gap to be placed on the SIMPL+ symbol so chosen inputs and outputs can be made to line up visually. _SKIP_ can be used with parameters as well. This is a graphic consideration only and does not have an effect on the input and output relationships of the symbol.

NOTE: The _SKIP_ keyword can be used in DIGITAL_INPUT, DIGITAL_OUTPUT, ANALOG_INPUT, ANALOG_OUTPUT, BUFFER_INPUT, STRING_INPUT, STRING_OUTPUT, INTEGER_PARAMETER, LONG_INTEGER_PARAMETER, SIGNED_INTEGER_PARAMETER, SIGNED_LONG_INTEGER_PARAMETER and STRING_PARAMETER declarations.

Example:

DIGITAL_INPUT osc_in, _SKIP_, toggle_in;

ANALOG_OUTPUT an_level1, an_level2, _SKIP_, an_level3;

LONG_INTEGER_PARAMETER temp_level_min, _SKIP_, temp_level_max;

Language Constructs & Functions
Compiler Directives
SKIP
_SKIP_


#SYMBOL_NAME

# #SYMBOL_NAME

Name:

#SYMBOL_NAME

Syntax:

    #SYMBOL_NAME "\<name of symbol\>"

Description:

By specifying \<name of symbol\>, this name will show up on the header of the symbol in the detail view as well as in the USER SIMPL+ section of the Symbol Library. If this directive is not present, the default name shown in the Symbol Library/Program View/Detail view is the name of the USP file as saved on disk. For example, if the file is saved as "Checksum Program.USP", the tree views will show "Checksum Program" as the name.

Example:

    #SYMBOL_NAME "My SIMPL+ Program"

Version:

X Generation:  SIMPL v1.20.01 and later

2-Series:  SIMPL v2.01.05 and later

Language Constructs & Functions
Compiler Directives
SYMBOL NAME
#SYMBOL_NAME


#USER_LIBRARY

# #USER_LIBRARY

Name:

#USER_LIBRARY

Syntax:

    #USER_LIBRARY "\<User Library Name\>"

Description:

Directs the compiler to include code from a User written library. The module name specified is the User Library Filename without the USL extension that is used by User Libraries. Relative or absolute path are not allowed within this directive (see #INCLUDEPATH).

The compiler will search for the library in the following order:

   1)  Project Folder

   2)  Global SIMPL+ Folder (refer to Edit | Preferences | Paths in SIMPL).

   3)  Paths specified in #INCLUDEPATH compiler directive

Example:

    #USER_LIBRARY "MyFunctions"

Directs the compiler to include the User Library "MyFunctions.usl" from the User SIMPL+ directory. User libraries can be created by saving a SIMPL+ module as type SIMPL+ library, instead of the default SIMPL+ file.

Version:

X-Generation

SIMPL v1.50.06

SIMPL v2.01.05 and later, Global variables can no longer be declared within User Library (.usl) files.

2-Series

SIMPL v2.01.05 and later [Same features as X Generation SIMPL v2.01.05]

3-Series

SIMPL v4.00.00 and later

4-Series

SIMPL v4.14.06 and later

Language Constructs & Functions
Compiler Directives
USER LIBRARY
#USER_LIBRARY


#USER_SIMPLSHARP_LIBRARY

# #USER_SIMPLSHARP_LIBRARY

Name:

#USER_SIMPLSHARP_LIBRARY

Syntax:

    #USER_SIMPLSHARP_LIBRARY "\<SIMPL# Library Name\>"

Description:

Directs the compiler to include code from a User SIMPL# library. The module name specified is the library filename without the CLZ extension. Relative or absolute path are not allowed within this directive (see #INCLUDEPATH).

The compiler will search for the library in the following order:

   1)  Project Folder

   2)  Global SIMPL+ Folder (refer to Edit | Preferences | Paths in SIMPL).

   3)  Paths specified in #INCLUDEPATH compiler directive

Example:

    #USER_SIMPLSHARP_LIBRARY "MyLibrary"

Directs the compiler to include the User SIMPL# Library, "MyLibrary.clz".

Version:

3-Series

SIMPL v4.02.00 and later

4-Series

SIMPL v4.14.06 and later

Language Constructs & Functions
Compiler Directives
USER SIMPLSHARP LIBRARY
#USER_SIMPLSHARP_LIBRARY


Compiler Directives Overview (Part 1)

# Compiler Directives Overview

Compiler directives are used by the SIMPL+ compiler to control attributes of the symbol without generating actual SIMPL+ code. They come at the beginning of the program, and are used to provide explicit instructions to the compiler. As such, directives are not part of the SIMPL+ language itself and are distinguished from actual SIMPL+ code by the pound sign (#) preceding their names.

Compiler directives are provided in the template file that is created when a new program is started. The compiler directives are as follows:

|  |  |
|----|----|
| Directive | Description |
| [#ANALOG_SERIAL_EXPAND] | This provides a way to expand, or add, inputs and/or outputs for a specified symbol. |
| [#BEGIN_PARAMETER_PROPS, #END_PARAMETER_PROPS] | This directive is used to declare parameter properties. |
| [#CATEGORY] | A Category is the name of the folder in the Logic Symbols library tree where the module is shown. |
| [#CRESTRON_LIBRARY] | Directs the compiler to include code from a Crestron provided library. |
| [#DEFAULT_NONVOLATILE] | Program variables retain their value if hardware power is lost. |
| [#DEFAULT_VOLATILE] | Program variables will not retain their value if hardware power is lost. |
| [#DEFINE_CONSTANT] | Define a \<constant_value\> that will be substituted anywhere in the current source file where \<constant_name\> is used. |
| [#DIGITAL_EXPAND] | This provides a way to expand, or add, inputs and/or outputs for a specified symbol. |
| [#ENABLE_STACK_CHECKING] | Allows run-time stack checking to be performed on a given module.  If there is a stack overflow, an error will be produced. |
| [#HELP] | Several #HELP lines can be specified. |
| [#HELP_BEGIN … #HELP_END] | The #HELP_BEGIN, #HELP_END pair makes it easier to create help since each line does not need a separate #HELP directive. |
| [#HINT] | The #HINT shows up in the status bar and provides a short tactical clue as to the function of the symbol in the same way that Crestron-defined built-in symbols do. |
| [#IF_DEFINED … #ENDIF] | Results in compilation of the \<code\> only if \<constant_name\> has not been  previously defined. |
| [#IF_NOT_DEFINED … #ENDIF] | Results in compilation of the \<code\> only if \<constant_name\> has not been  previously defined. |
| [#LARGE_STACK] | This is used to increase the stack size when necessary. |
| [#OUTPUT_SHIFT] | This provides a way to arrange the inputs and outputs on the symbol graphic so that they line up and are easy to read. |
| [#SYMBOL_NAME] | By specifying \<name of symbol\>, this name will show up on the header of the symbol in the detail view as well as in the USER SIMPL+ section of the Symbol Library. |
| [#USER_LIBRARY] | Directs the compiler to include code from a User written library. |

Language Constructs & Functions
Compiler Directives
rlt1D5
Compiler Directives Overview


Compiler Directives Overview (Part 2)

  [#ANALOG_SERIAL_EXPAND]: _ANALOG_SERIAL_EXPAND.md
  [#BEGIN_PARAMETER_PROPS, #END_PARAMETER_PROPS]: _BEGIN_PARAMETER_PROPS.md
  [#CATEGORY]: _CATEGORY.md
  [#CRESTRON_LIBRARY]: _CRESTRON_LIBRARY.md
  [#DEFAULT_NONVOLATILE]: _DEFAULT_NONVOLATILE.md
  [#DEFAULT_VOLATILE]: _DEFAULT_VOLATILE.md
  [#DEFINE_CONSTANT]: _DEFINE_CONSTANT.md
  [#DIGITAL_EXPAND]: _DIGITAL_EXPAND.md
  [#ENABLE_STACK_CHECKING]: _ENABLE_STACK_CHECKING.md
  [#HELP]: _HELP.md
  [#HELP_BEGIN … #HELP_END]: _HELP_BEGIN_…__HELP_END.md
  [#HINT]: _HINT.md
  [#IF_DEFINED … #ENDIF]: _IF_DEFINED_…__ENDIF.md
  [#IF_NOT_DEFINED … #ENDIF]: _IF_NOT_DEFINED_…__ENDIF.md
  [#LARGE_STACK]: _LARGE_STACK.md
  [#OUTPUT_SHIFT]: _OUTPUT_SHIFT.md
  [#SYMBOL_NAME]: _SYMBOL_NAME.md
  [#USER_LIBRARY]: _USER_LIBRARY.md

|
| [#USER_LIBRARY] | Directs the compiler to include code from a User written library. |


#BEGIN_PARAMETER_PROPS, #END_PARAMETER_PROPS (Part 1)

# #BEGIN_PARAMETER_PROPS, #END_PARAMETER_PROPS

Name:

#BEGIN_PARAMETER_PROPS, #END_PARAMETER_PROPS

Syntax:

    #BEGIN_PARAMETER_PROPERTIES parameter_variable, parameter_variable

   //propValidUnits=//unitString or unitDecimal|unitHex|unitPercent|unitCharacter|unitTime|unitTicks

   // propDefaultUnit=//unitString or unitDecimal|unitHex|unitPercent|unitCharacter|unitTime|unitTicks

   // propDefaultValue=

   // propList=//{ "value","label" },{ "value","label" }

   // propLowerBound=lower_bound

   // propUpperBound=lower_bound

   // propShortDescription=

   // propFullDescription=

   // propNotes=

#END_PARAMETER_PROPERTIES

NOTE: The keywords used to describe the properties ValidUnits, DefaultUnits, DefaultValue, List, LowerBound, UpperBound, ShortDescription, FullDescription and Notes are prefixed by the word "prop" in this directive (e.g., propValidUnits. propDefaultUnit, etc.). This applies only to this directive.

NOTE: The keywords used to describe the units Decimal, Hex, Percent, Character, Time and Ticks are prefixed by the word "unit" in this directive (e.g., unitDecimal. unitString, etc.). This applies only to this directive.

Description:

This directive is used to declare parameter properties that don't change at runtime. The parameter, variables and properties to be declared, immediately follow the #BEGIN_PARAMETER_PROPS directive. The values of the parameter properties are set between the #BEGIN_PARAMETER_PROPS and #END_PARAMETER_PROPS directives.

NOTE: If the variables are arrayed elements, the usual [ ] notation should not be used.

The parameters that are introduced to SIMPL+ by this directive are similar in form and function to their existing namesakes. For example, SIGNED_INTERGER_PARAMETER possesses the same basic attributes as SIGNED_INTEGER. The new parameters are:

Parameters:

|                               |                       |
|-------------------------------|-----------------------|
| Parameter                     | Similar to:           |
| Non-Arrayed                   |                       |
| INTEGER_PARAMETER             | [INTEGER]             |
| SIGNED_INTEGER_PARAMETER      | [SIGNED_INTEGER]      |
| LONG_INTEGER_PARAMETER        | [LONG_INTEGER]        |
| SIGNED_LONG_INTEGER_PARAMETER | [SIGNED_LONG_INTEGER] |
| STRING_PARAMETER              | [STRING]              |
| Arrayed                       |                       |
| INTEGER_PARAMETER             | [INTEGER]             |
| SIGNED_INTEGER_PARAMETER      | [SIGNED_INTEGER]      |
| LONG_INTEGER_PARAMETER        | [LONG_INTEGER]        |
| SIGNED_LONG_INTEGER_PARAMETER | [SIGNED_LONG_INTEGER] |
| STRING_PARAMETER              | [STRING]              |

NOTE: The STRING parameters only set properties for propDefaultValue, propList, propShortDescription, propFullDescription and propNotes. All other values will be ignored.

The following values are set by this directive:

Values:


#BEGIN_PARAMETER_PROPS, #END_PARAMETER_PROPS (Part 2)

| Value                          | Description                                                                                |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| propDefaultValue               | This is the default value that will be shown in the parameter field in SIMPL. If there is no default value specified, there will be no default value shown in SIMPL. If the variable is an array, then this will be used for all parameters.                                                                                |
| propDefaultUnit                | This can be unitString, unitDecimal, unitHex, unitPercent, unitCharacter, unitTime or unitTicks depending on the parameter being declared. If this value is not specified, then it will be taken from–in the following order–propDefaultValue, propList (val1), propLowerBound and propUpperBound.                                                                                |
| propValidUnits                 | This is a comma-separated list of a combination of any or all of unitString, unitDecimal, unitHex, unitPercent, unitCharacter, unitTime or unitTicks strings. (e.g., if propValidUnits=unitHex, unitDecimal, then only "h" and "d" constants would be accepted. Any others (e.g., 25%) would be rejected. If nothing is specified, then this field should be assumed to be: unitString, unitDecimal, unitHex, unitPercent, unitCharacter, unitTime or unitTicks.                                                                                |
| propList                       | This provides a drop-down list for a parameter. The list will show the contents of the "Label" field, but when compiled, the choice in the "Label" field is converted to the value specified in the appropriate Val field. For example: if propList=25h,"Address1",26h,"Address2" then a drop-down list is shown containing 2 choices: Address1 and Address2. If the Address1 is chosen, when the program is compiled, the parameter passed is actually 25h. If propList and propUpperBound/propLowerBound are both specified, propList will take priority and propUpperBound/propLowerBound will be ignored. |
| propUpperBound, propLowerBound | Although a legal range of values is implied by the type of parameter being used, it is possible to further restrict that range by specifying propUpperBound and/or propLowerBound.                                                                                |
| propShortDescription           | Text entered in this field, contained within double quotes, becomes the status bar hint in SIMPL.                                                                                |
| propFullDescription            | The text entered in this field, contained within double quotes, becomes the Parameter Properties text.                                                                                |
| propNotes                      | The text entered in this field, contained within double quotes, becomes the Parameter Properties text.                                                                                |

All other values will be ignored. The following values are set by this directive:

Values:


#BEGIN_PARAMETER_PROPS, #END_PARAMETER_PROPS (Part 3)

NOTE: For propDefaultValue: if the user enters a value in a parameter field and then moves away from that field, the value will be assumed to be that of the specified units (if any). Therefore entering a 5 in the field will assume 5 seconds if propDefaultUnit=unitTime, etc.

NOTE: For propList: the Label field is contained in double quotes and therefore allowed to contain any character including spaces and commas.

Example:

    DIGITAL_INPUT trig;

   INTEGER_PARAMETER DelayTime;

   STRING_INPUT MyString[20];

   STRING_PARAMETER DeviceCode[33];

#BEGIN_PARAMETER_PROPS DelayTime

   propDefaultValue=5s

   propValidUnits=unitTime,unitTicks

   propUpperBound=25s

   propLowerBound=36s

#END_PARAMETER_PROPS

#BEGIN_PARAMETER_PROPS DeviceCode

   propDefaultValue="35"

#END_PARAMETER_PROPS

push trig

{

   String LocalString[50];

   Delay(DelayTime);

   LocalString = MyString + "Stuff" + DeviceCode;

   print("the string is %s, The DeviceCode is %s", LocalString, DeviceCode);

}

Version:

SIMPL+ Version 3.03.00 or later

Control System:

2 Series Only, CUZ 4.00 or later

  [INTEGER]: javascript:void(0);
  [SIGNED_INTEGER]: javascript:void(0);
  [LONG_INTEGER]: javascript:void(0);
  [SIGNED_LONG_INTEGER]: javascript:void(0);
  [STRING]: javascript:void(0);

|
| propNotes                      | The text entered in this field, contained within double quotes, becomes the Parameter Properties text. |


Compiler Error 1000

# Compiler Error 1000

syntax error:  '\<identifier\>' already defined

The specified identifier was declared more than once.  A variable can only be declared once within it’s function scope.  The same identifier cannot be used for more than one declaration type.

NOTE: Scope refers to the level at which an Event, user-defined function or statement resides.  Having a global scope means that the function or variable can be called or accessed from anywhere within the program.  A local scope means that the variable can only be accessed from within the event or function that it resides in.

- Make sure the identifier has not been declared as another declaration type, user-defined function, or structure definition.

The following are examples of this error:

INTEGER i;

INTEGER i;        // error – i is already defined as an INTEGER

STRING i[100];    // error – i is already defined as an INTEGER

STRUCTURE myStruct

{

   INTEGER i;     // ok – i is a member variable of myStruct

}

INTEGER_FUNCTION MyFunc( INTEGER x, INTEGER y )

{

   INTEGER i;     // ok

   INTEGER i;     // error - i is already defined as a local INTEGER

   INTEGER x;     // error – x is already defined as a function

                  //         parameter, which makes it a local

                  //         variable in this function

}

FUNCTION MyFunc() // error – MyFunc() is already defined

                  //         as an INTEGER_FUNCTION

{

}

FUNCTION AnotherFunc( INTEGER x, INTEGER y  ) // ok – x and y are

                                              // local to this function

{

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1000

AnotherFunc Compiler Error FUNCTION INTEGER INTEGER_FUNCTION MyFunc STRING STRUCTURE


Compiler Error 1001

# Compiler Error 1001

syntax error:  Undefined variable: '\<identifier\>'

                                Undefined function ‘\<identifier\>’

The specified identifier was not declared.

All variables and user-defined functions must be declared before they are used.  They must be declared either globally or within the same function scope.  Variables from one program are not accessible from another program.

NOTE: Scope refers to the level at which an Event, user-defined function or statement resides.  Having a global scope means that the function or variable can be called or accessed from anywhere within the program.  A local scope means that the variable can only be accessed from within the event or function that it resides in.

-  Make sure the identifier is spelled correctly

-  Make sure the identifier has not been declared locally within another function

-  When using structures, make sure the proper ‘dot’ notation is being used when accessing the structure’s variables (see example below)

The following are examples of this error:

INTEGER i;

STRUCTURE myStruct

{

   INTEGER structMember;

   INTEGER structArrMember[10];

}

myStruct struct;

myStruct structArr[10];

FUNCTION MyFunc( INTEGER x )

{

   INTEGER k;

   i = 1;                               // ok

   k = 3;                               // ok

   x = 4;                               // ok

   struct.structMember = 5;             // ok – proper ‘dot’ notation

   struct.structMember[1] = 6;          // ok – proper ‘dot’ notation

   structArr[1].structMember = 7;       // ok – proper ‘dot’ notation

   structArr[1].structArrMember[2] = 8; // ok – proper ‘dot’ notation

   j = 2;                  // error – j is not declared

   structMember = 10;      // error – improper ‘dot’ notation

   structMember[1] = 11;   // error – structMember is not an array

   k = AnotherFunc();      // error – AnotherFunc() was not

                           //         declared previously

}

INTEGER_FUNCTION AnotherFunc()

{

   k = 5;             // error – k is a local variable of MyFunc()

   x = 6;             // error – x is a local variable of MyFunc()

   Call MyFunc();     // ok

   Call MyFunk();     // error – spelling error

   return (1);

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1001

AnotherFunc Compiler Error FUNCTION INTEGER INTEGER_FUNCTION MyFunc MyFunk STRUCTURE


Compiler Error 1002

# Compiler Error 1002

syntax error:  Missing '\<token\>'

A language element was expected and not found.  The compiler expects certain language elements to appear before or after other elements.  If any other language element is used, the compiler cannot understand the statement.  Examples are missing parenthesis after a function call, missing semicolons after a statement and missing braces when defining functions.

NOTE:  A token is a language element such as a keyword or operator. Anything that is not whitespace (i.e.:  spaces, tabs, line feeds and comments) is a token.

- Examine the last uncommented non-blank line or statement within the program.  If a token was required in a previous statement and was not encountered, the compiler will continue onto the next line and mark the first token of the new statement as the error.

The following are examples of this error:

STRUCTURE MyStruct

{

   INTEGER x;

   STRING s[100];

}

MyStruct struct;         // error – missing ‘;’ from preceding

                         //         structure definition

INTEGER_FUNCTION MyFunc( INTEGER ) // error – argument variable

                                   //         not specified

   INTEGER x;            // error – ‘{’ missing before INTEGER

   Print “abc”;          // error – missing parenthesis

                         //         should be Print (“abc” );

   // printing…

   Print “def”           // error – error message will occur on

                         //         next statement

   // more printing…

   Print “ghi”;          // error – missing ‘;’from preceding Print

                         //         statement

   x = ((1+2) + 3;       // error – unmatched set of parentheses

   x = atoi( “abc”, 1 ); // error – atoi() does not take 2 arguments

   if ( x = 4 )

      return 5;          // error – should be return (5);

   return (6);           // ok

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1002

Compiler Error INTEGER INTEGER_FUNCTION MyFunc Print STRING STRUCTURE


Compiler Error 1003

# Compiler Error 1003

syntax error:  Incorrect type '\<decl_type\>', expected type(s):

                                                  '\<decl_type1[,decl_type2] [,decl_typen]\>'

                         Incorrect type, expected type(s):

                                                  '\<decl_type1[,decl_type2][,decl_typen]\>'

A specific variable or type was expected and not found.  Examples are variables of one type being used in place of another, and incorrect variable types within function arguments.

The following are examples of this error:

STRING_FUNCTION MyFunc( INTEGER x )

{

   INTEGER y;

   x = getc( y );   // error – y is not of type STRING

   x = MyFunc( 1 ); // error – x cannot accept the resulting string

                    //         returned from MyFunc()

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1003

Compiler Error INTEGER MyFunc STRING STRING_FUNCTION


Compiler Error 1004

# Compiler Error 1004

syntax error:  Unmatched symbol: '\<identifier\>'

Some language constructs are composed of more than one keyword.  In these cases, each keyword may require statements before and after it is used.

For example, the Switch statement uses the following keywords, Switch, Case, and Default.  If the keyword, Case, is encountered before or outside of switch statement, this error will result.

The following are examples of this error:

FUNCTION MyFunc( INTEGER x )

{

   x = 1;

   while ( 1 )

   {

      x = x + 1;

   } until ( x \> 5 ); // error – ‘until’ is not part of the

                      //         ‘while’ construct

   else               // error – no preceding ‘if’ statement

   {

      x = 0;

   }

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1004


Compiler Error 1005

# Compiler Error 1005

syntax error:  Unexpected symbol in compiler directive:  '\<identifier\>'

An invalid identifier is following a compiler directive.

The following are examples of this error:

#DEFINE_CONSTANT   MyIntConst   100  // ok

#DEFINE_CONSTANT  “MyIntConst”  100  // error – MyIntConst should not

                                     //         be in quotes – this

                                     //         will be evaluated as

                                     //         a literal string

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1005


Compiler Error 1006

# Compiler Error 1006

syntax error:  Invalid #DEFINE_CONSTANT value: '\<identifier\>'

The value for a #DEFINE_CONSTANT compiler directive must be either a literal string or an integer value.  Expressions, variables, functions and events cannot be specified as the compiler directive’s value.

The following are examples of this error:

INTEGER x;

#DEFINE_CONSTANT  MyIntConst    100       // ok

#DEFINE_CONSTANT  MyStrConst    “abc”     // ok

#DEFINE_CONSTANT  MyExprConst   (1+2)     // error – expressions are

                                          //         not allowed

#DEFINE_CONSTANT  MyVarConst    x         // error – substitutions are

                                          //         not allowed

#DEFINE_CONSTANT  MyExprConst   (x+1)     // error – macros are not

                                          //         supported

#DEFINE_CONSTANT  MyFuncConst   myFunc    // error

#DEFINE_CONSTANT  MyFuncConst   getc      // error

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1006

Compiler DEFINE_CONSTANT Error INTEGER MyExprConst


Compiler Error 1007

# Compiler Error 1007

syntax error:  Missing array index: '\<identifier\>'

A variable declared as an array is being used within an expression without the array index being specified.  For two-dimensional arrays, both indices must be specified.  When passing entire arrays as function arguments, no index is needed.

The following are examples of this error:

FUNCTION MyFunc()

{

   INTEGER i, arr[10], arr2[10][20];

   STRING str[100], str2[100][50];

   i = arr[5];                       // ok

   i = arr2[5][10];                  // ok

   arr[5] = arr2[5][10];             // ok

   arr2[5][10] = 5;                  // ok

   i = arr;                          // error – no index specified

   arr = 5;                          // error – no index specified

   i = arr2[5];                      // error – 2nd index not specified

   str2[5] = “a”;                    // ok

   str[5] = “a”;                     // error – ‘str’ is not an array

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1007

Compiler Error FUNCTION INTEGER MyFunc STRING


Compiler Error 1008

# Compiler Error 1008

syntax error:  Invalid integer argument or undefined variable: '\<identifier\>'

The construct being used requires either an integer value or variable passed as a function argument.

- Make sure the variable has been declared

The following are examples of this error:

STRUCTURE MyStruct

{

   INTEGER x;

   STRING s[100];

}

MyStruct struct;

Function MyFunc()

{

   INTEGER i;

   STRING s[100];

   for ( i = 1 to 10 )        // ok

   {

      for ( j = 1 to 5 )      // error – ‘j’ has not been declared

      {

         x = j;               // error – should be struct.x = j;

      }

      for ( s = “a” to “z” )  // error – strings are not allowed

      {

      }

   }

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1008

Compiler Error INTEGER MyFunc STRING STRUCTURE


Compiler Error 1009

# Compiler Error 1009

syntax error:  Missing structure member: '\<identifier\>'

                         Structure does not contain member: '\<identifier\>'

Variables contained within structures are required when using structures within an expression or statement.  When using structures, the ‘dot’ notation is required to specify a structure’s variable.

The notation is as follows:  \<structure_name\>.\<member_variable\>

Structure arrays are as follows:  \<structure_name\>[index].\<member_variable\>

The following are examples of this error:

STRUCTURE MyStruct

{

   INTEGER x;

   INTEGER x2[10];

}

Function MyFunc( INTEGER x )

{

   INTEGER i;

   MyStruct struct;

   MyStruct structArr[10];

   i = struct.x;                  // ok

   struct.x = 5;                  // ok

   struct.x2[2] = 5;              // ok

   structArr[1].x2[2] = 5;        // ok

   Call MyFunc( i );              // ok

   Call MyFunc( struct.x );       // ok

   Call MyFunc( structArr[1].x ); // ok

   Call MyFunc( struct.x2[1] );   // ok

   i = struct;             // error – structure variable not specified

   struct = i;             // error – structure variable not specified

   Call MyFunc( struct );  // error – structure variable not specified

   i = struct.z;           // error – structure variable does not exist

   struct.z = 5;           // error – structure variable does not exist

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1009


Compiler Error 1010

# Compiler Error 1010

syntax error:  Symbol Name contains illegal character: ';'

The compiler directive, #SYMBOL_NAME, cannot contain a semicolon as part of the symbol name.

The following are examples of this error:

#SYMBOL_NAME “MySymbol”             // ok

#SYMBOL_NAME “My Symbol”            // ok

#SYMBOL_NAME “MySymbol;YourSymbol”  // error

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1010


Compiler Error 1011

# Compiler Error 1011

syntax error:  Missing return value

The Return statement requires a valid value or expression when used inside of functions that return a value (INTEGER_FUNCTION, STRING_FUNCTION, etc.).  The Return statement is available for functions that don’t return a value (FUNCTION), but do not allow values to be returned.

The following are examples of this error:

FUNCTION MyFunc( INTEGER x )

{

   if ( x=1 )

      return;      // ok – MyFunc() does not return a value

   return (5);     // error – MyFunc is declared as FUNCTION and

                   //         cannot return a value

}

INTEGER_FUNCTION AnotherFunc( INTEGER x )

{

   if ( x=1 )

      return;      // error – MyFunc is declared as an INTEGER_FUNCTION

                   //         and must return a value

   else if ( x=2 )

      return (5);  // ok

   else if ( x=3 )

      return ();   // error – no value or expression is given

   return (x);     // ok

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1011

AnotherFunc Compiler Error FUNCTION INTEGER INTEGER_FUNCTION MyFunc STRING_FUNCTION


Compiler Error 1012

# Compiler Error 1012

syntax error:  Unterminated string constant

A literal string was used and was not contained within quotes.   If a quotation character is needed within a literal string, a backslash should be placed before the quotation character (i.e.:  \\).  This will indicate to the compiler that the quotation character is not the terminating quote for the literal string.

The following are examples of this error:

FUNCTION MyFunc()

{

   Print( "%s", "abc\\" );  // ok

   Print( "%s", "abc\\ );   // error - \\ is not a closing quote

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1012


Compiler Error 1013

# Compiler Error 1013

syntax error:  Source code does not evaluate to anything

A statement must perform an action in order to be valid.  If no action is specified, the statement will not be useful to the program.

The following are examples of this error:

FUNCTION MyFunc()

{

   INTTEGER x;

   STRING str[100];

   x = 5;       // ok

   str = “abc”; // ok

   x;           // error

   str;         // error

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1013


Compiler Error 1014

# Compiler Error 1014

syntax error:  Invalid Parameter:  \<’parameter_variable’\>

                           Missing Parameters in directive construct

The compiler was expecting a parameter type variable and another declaration type or token was found.

The following are examples of this error:

INTEGER_PARAMETER iParam;

#BEGIN_PARAMETER_PROPERTIES // error – no parameter was

                                       specified

propDefaultUnit = unitDecimal;

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam // ok – iParam is a declared

                                           parameter

propDefaultUnit = unitDecimal;

#END_PARAMETER_PROPERTIES

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1014


Compiler Error 1015

# Compiler Error 1015

syntax error:  Invalid Parameter Unit(s): '\<property_unit\>'

The compiler was expecting a parameter unit and another token or type was found.

The following are examples of this error:

INTEGER_PARAMETER iParam, iAnotherParam;

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal | unitHex |

                    unitPercent | unitCharacter |

                    unitTime | unitTicks; // ok

propDefaultUnit = unitDecimal // ok

propDefaultUnit = unitString; // error – unitString is not a

                                  valid Parameter Unit

#END_PARAMETER_PROPERTIES

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1015


Compiler Error 1016

# Compiler Error 1016

syntax error:  Invalid Parameter Property or

                          #END_PARAMETER_PROPERTIES not

                           found  \<’parameter_property’\>

The compiler was expecting a parameter property and another token or type was found.

The following are examples of this error:

INTEGER_PARAMETER iParam, iAnotherParam;

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal|unitHex;

   propDefaultUnit = unitDecimal; // ok –unitDecimal is a valid

                                         Parameter Property.

propDefaultValue = 10d;

propList = {10d, "value1"}, {20d, "value2" };

propBounds = 1d, 20d;

propShortDescription = "a short description";

propFullDescription = "a full description.....";

propNotes = "Here's the notes";

Integer i; // error – Integer is not

              A valid Parameter Property

// #END_PARAMETER_PROPERTIES // error – comment line

#END_PARAMETER_PROPERTIES // ok

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1016


Compiler Error 1017

# Compiler Error 1017

**syntax error:**  **SIMPL# Classes and Structures are case-sensitive: **

**                           ‘\<variable_name\>’**

All code within SIMPL# Libraries is case-sensitive, therefore upper case and lower case characters are distinct. All class, structure and variable calls and references from SIMPL+ must use the same case as that used within the SIMPL# code.

The datatype (class or structure name) and class/structure members within the SIMPL# Library are case-sensitive. The variable declared within the SIMPL+ module is not case-sensitive.

For example, the classes, ‘MyClass’ and ‘myClass’ are different.

The following are examples of this error:

SIMPL# Library

// SimplSharpLibrary.clz

public class MyClass

{

   public int intVar;

   public int IntFunction();

}

public struct tagMyStruct

{

   public string myString;

}

SPlusModule.usp

// UserModule.usp

#USER_SIMPLSHARP_LIBRARY "SimplSharpLibrary"

MyClass class1;         // ok – matching case

myclass class2;         // error – case doesn’t match

tagMyStruct myStruct1;  // ok – matching case

TagmyStruct myStruct2;  // error – case doesn’t match

FUNCTION MyFunction ( STRING str )

{

   class1.intVar = 1; // ok – intVar is the same case

   CLASS1.intVar = 2; // ok – CLASS1 is not case-sensitive.

                              It is the variable declared

                              within SIMPL+ (not SIMPL#).

                              intVar is case-sensitive since

                              it is a SIMPL# structure

                              member.

   myfunction( myStruct1.myString ); // ok, myfunction is a

                                            function declared within

                                            SIMPL+

   class1.INTFUNCTION(); // error – INTFUNCTION is case-sensitive.

                                    Should be IntFunction

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1017

Compiler Error FUNCTION INTFUNCTION IntFunction MyFunction STRING


Compiler Error 1100

# Compiler Error 1100

fatal error:  Statement outside of function scope

User-defined functions, Events, and compiler directives can only be defined at a global level.

NOTE: Scope refers to the level at which an Event, user-defined function or statement resides.  Having a global scope means that the function or variable can be called or accessed from anywhere within the program.  A local scope means that the variable can only be accessed from within the event or function that it resides in.

Variables can have either a global or local scope.

The following are examples of this error:

INTEGER i;

STRING str[100];

#DEFINE_CONSTANT  myConst  1  // ok

#DEFINE_CONSTANT  myConst  2; // error – semicolon is not needed

i = 5;         // error – variables can only be used within a

               // function or event

Call MyFunc(); // error – functions can only be called from

               //         another function or event

;              // error – a semicolon is valid statement (which

               //         does nothing), and is not contained

               //         within a function or event

{              // error – braces only signify a group of

               // statements within a function or

               // construct (i.e.: if-else, while, etc)

   INTEGER x;

   INTEGER y;

}

Print( “outside of everything” ); // error – statement is

                                  // not contained within

                                  // a function or event

FUNCTION MyFunc()                 // ok

{

}

Function Main()     // ok – Function Main gets called automatically

                    //      at the start of the program

{

   i = 5;           // ok

   str = “”;        // ok

   Call MyFunc();   // ok

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1100

Compiler DEFINE_CONSTANT Error FUNCTION INTEGER Main MyFunc Print STRING


Compiler Error 1101

# Compiler Error 1101

fatal error:  Abort - Error count exceeded \<max_errors\>

When compiling, if the error count is too large, the compiler will terminate the compile process prematurely.  This can not only be a tremendous time saver, but also help reduce the aggravation and stress levels of the programmer.

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1101


Compiler Error 1200

# Compiler Error 1200

expression error:  Invalid numeric expression: '\<expression\>'

                                   Invalid string expression

                                   Invalid expression: '\<expression\>'

Expressions can be calculations, comparisons, or the validity of a value from a string or numeric variable or value.  All expressions require that all variables and values within the equation are of the same type.  For example, you cannot add or compare an integer and a string together.  The result of a comparison (i.e.: “abc” = “def”) is always a numeric value and will be treated as a numeric expression.

The following are examples of this error:

INTEGER x, y;

STRING str[100];

INTEGER_FUNCTION myFunc( INTEGER i )

{

   x = (1 + 2);                          // ok

   if ( x \> y )                          // ok

   {

      if ( i )                           // ok

      {

         if ( str = “abc” )              // ok

         {

            while ( 1 )                  // ok

            {

               x = x + y + myFunc(1);    // ok

               break;

            }

         }

      }

   }

   return (1);

}

INTEGER_FUNCTION AnotherFunc( INTEGER i )

{

   x = (1 + str);                 // error – cannot add an integer

                                  //         and string

   if ( x \> “abc” )               // error – cannot compare an integer

                                  //         and string

   {

      if ( str )                  // error – cannot check the validity

                                  //         of a string

      {

         if ( str = MyFunc(1) )   // error – cannot add strings

                                  //         and integers together

         {

            while ( str \< “abc” ) // ok

            {

               x = (x + );        // error – incomplete expression

               break;

            }

         }

      }

   }

   return (1);

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1200

AnotherFunc Compiler Error INTEGER INTEGER_FUNCTION MyFunc STRING


Compiler Error 1201

# Compiler Error 1201

expression error:  Invalid \\x sequence

                               Invalid \\x sequence: '\<expression\>'

A hexadecimal sequence within a literal string contained an invalid format.  Characters represented by a hexadecimal number must follow the format:  \xXX, where ‘\x’ signifies that a hexadecimal sequence is to follow and XX is the 2 digit hexadecimal value.

The following are examples of this error:

Function myFunc()

{

   STRING str[100];

   MakeString( str, “Sending commands \xFF” );         // ok

   MakeString( str, “Sending commands \x41\x1A\xFF” ); // ok

   MakeString( str, “Sending cmd \x4” );  // error – 2 digits required

   MakeString( str, “Sending cmd \x” );   // error – hex code expected

   MakeString( str, “Sending cmd \xZZ” ); // error – invalid hex code

   MakeString( str, “Sending cmd \xZZ” ); // error – invalid hex code

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1201


Compiler Error 1300

# Compiler Error 1300

declaration error:  Array size missing

                                 Array size invalid

STRING, STRING_INPUT and BUFFER_INPUT variables require a valid length.  A length is specified by number enclosed within brackets.  Arrays for these datatypes are specified by the first set of brackets containing the number of strings and the second set of brackets containing the total length for each string.  Two-dimensional arrays are not allowed for these datatypes.

In a function’s argument list, since all strings are passed by reference, no array size is necessary.  A string array is indicated by an empty set of brackets.  See example below.

The following are examples of this error:

#DEFINE_CONSTANT   ARR_SIZE   100

STRING str[100];                 // ok – str has a length of 100

STRING_INPUT strIn[ARR_SIZE];    // ok – strIn has a length of 100

BUFFER_INPUT bufIn[ARR_SIZE];    // ok – bufIn has a length of 100

STRING strArr[50][100];          // ok – 51 strings of length 100

STRING_INPUT strIn[50][100];     // ok - 51 strings of length 100

BUFFER_INPUT bufIn[50][100];     // ok – 51 strings of length 100

STRING_OUTPUT strOut;            // ok – STRING_OUTPUTs do not

                                 //      require a length

STRING_OUTPUT strOutArr[10];     // ok – array of 10 STRING_OUTPUTs

STRING str2;                     // error – no length specified

STRING_INPUT strIn;              // error – no length specified

BUFFER_INPUT bufIn;              // error – no length specified

STRING_OUTPUT strOutArr[10][20]; // error – 2-D arrays not supported

STRING str[x];                   // error – variables are not allowed

STRING str[myFunc()];            // error – function calls are

                                 //         not allowed

FUNCTION myFunc( STRING sArg,       // ok – strings are passed by

                 STRING sArgArr[] ) //      reference. sArg is a

                                    //      string and sArgArr is a

                                    //      string array

{

}

FUNCTION myFunc2( STRING sArg[10],     // error – size is not allowed

                  STRING sArgArr[][] ) // error – 2-D strings not

                                       //         supported

{

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1300


Compiler Error 1301

# Compiler Error 1301

declaration error:  Invalid array index

An index is required when accessing any element of an array.  Two dimensional arrays require both indices of the array to be specified.  This index must be a valid numeric expression.

All arrays are passed to functions by reference, so specifying an index in this case is not allowed.

The following are examples of this error:

INTEGER xArr[10], x2dArr[10][20]; // ok

STRING str[100], strArr[50][100]; // ok

STRING_INPUT strIn[100];          // ok

STRING_OUTPUT strOut;             // ok

STRING str;                       // error – no length specified

STRING_INPUT strIn;               // error – no length specified

BUFFER_INPUT bufIn;               // error – no length specified

STRING_OUTPUT strOutArr[10][20];  // error – 2-D arrays not supported

STRING str[x];                    // error – variables are not allowed

STRING str[myFunc()];             // error – function calls are

                                  //         not allowed

INTEGER_FUNCTION MyIntFunc( INTEGER x[], INTEGER xArr[][] )

{

   xArr[1] = 5;                                         // ok

   xArr[1+2] = xArr[3+4];                               // ok

   xArr[1+xArr[2]] = xArr[xArr[3]];                     // ok

   xArr[MyIntFunc(xArr,x2dArr)] = 6;                    // ok

   x2dArr[1][2] = 6;                                    // ok

   x2dArr[xArr[1]][xArr[2]] = x2dArr[xArr[5]][xArr[6]]; // ok

   Call MyFunc( xArr, x2dArr );                         // ok

   xArr = 5;         // error – no index specified

   xArr[] = 0;       // error – no index specified

   xArr[str] = 6;    // error - s is a STRING

   xArr[5][6] = 7;   // error – xArr is not a 2D array

   xArr = xArr;      // error – cannot copy arrays

   xArr = x2dArr[1]; // error – cannot copy arrays

   x2dArr[1] = xArr; // error – cannot copy arrays

   Call MyIntFunc( xArr[5], x2dArr ); // error – cannot pass index

                                      //         arrays are passed

                                      //         by reference

}

FUNCTION MyStrFunc( STRING s, STRING s[] )   // ok

{

   STRING sLocal[100];

   str = “abc”;                              // ok

   strArr[5] = “def”;                        // ok

   strIn = s;                                // ok

   strOut = s;                               // ok

   sInArr[5] = “abc”;                        // ok

   sOutArr[5] = “abc”;                       // ok

   Call MyStrFunc( str, strArr );            // ok

   str[1] = “a”;    // error – s is a string, not an array

   sLocal = str[1]; // error – individual characters within

                    //         a string can only be accessed

                    //         with the function, Byte()

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1301

BUFFER_INPUT Byte Compiler Error FUNCTION INTEGER INTEGER_FUNCTION MyFunc MyIntFunc MyStrFunc STRING STRING_INPUT STRING_OUTPUT


Compiler Error 1302

# Compiler Error 1302

declaration error:  Variable name, ‘\<identifier\>’, exceeds maximum

                                      length of \<max\> characters

Variable names have a maximum length of 120 characters.

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1302


Compiler Error 1303

# Compiler Error 1303

declaration error:  Declaration type not allowed within structure: '\<identifier\>'

                                 Structure cannot contain String Arrays or Structure

                                      variables: '\<identifier\>'

                                 Structure definitions not allowed within other structures

                                 Local Structure declarations are not allowed

Structure datatypes can only be defined globally.  Variables of a defined structure datatype may be declared both globally and locally and passed as function arguments.  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 following are examples of this error:

STRUCTURE MyStruct                               // ok

{

   INTEGER i, i1[10], l2[10][20];                // ok

   SIGNED_INTEGER si, si1[10], si2[10][20];      // ok

   LONG_INTEGER l, l1[10], l2[10][20];           // ok

   SIGNED_LONG_INTEGER sl, sl1[10], sl2[10][20]; // ok

   STRING s[100];                                // ok

   STRING sArr[10];    // error – string arrays are not allowed

                       //         within structures

   DIGITAL_INPUT di;   // error – declaration type not allowed

   DIGITAL_OUTPUT do;  // error – declaration type not allowed

   ANALOG_INPUT ai;    // error – declaration type not allowed

   ANALOG_INPUT ao;    // error – declaration type not allowed

   STRING_INPUT si;    // error – declaration type not allowed

   BUFFER_INPUT bi;    // error – declaration type not allowed

   STRING_OUTPUT so;   // error – declaration type not allowed

   STRUCTURE locStruct // error – declaration type not allowed

   {

      INTEGER x;

   }

   MyStruct ptr;       // error – declaration type not allowed

}

FUNCTION MyFunc()

{

   STRUCTURE MyStruct  // error – local structures are not supported

   {

      INTEGER i, i1[10], l2[10][20];

   }

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1303


Compiler Error 1304

# Compiler Error 1304

declaration error:  Local variables must be declared at top of function

All local variables within a function block must be declared before any statements are encountered.  Local variables are not allowed to be declared within a block of statements such as inside an if-else or while loop.

The following are examples of this error:

FUNCTION MyFunc( INTEGER arg1, STRING arg2 ) // ok

{

   INTEGER i;                  // ok

   STRING str[100];            // ok

   Print( “Inside MyFunc!” );

   INTEGER j;                  // error

   if ( i \> 1 )

   {

      INTEGER k;               // error – if-statement block cannot

                                          contain local variables

   }

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1304

Compiler Error FUNCTION INTEGER MyFunc Print STRING


Compiler Error 1305

# Compiler Error 1305

declaration error:  Local functions not supported

A function cannot be defined within another function definition.  All function definitions must be defined with a global scope inside the module.

NOTE: Scope refers to the level at which an Event, user-defined function or statement resides.  Having a global scope means that the function or variable can be called or accessed from anywhere within the program.  A local scope means that the variable can only be accessed from within the event or function that it resides in.

The following are examples of this error:

FUNCTION MyFunc()          // ok – MyFunc is global

{

   FUNCTION MyLocalFunc()  // error – MyLocalFunc is local to MyFunc

   {

   }

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1305

Compiler Error FUNCTION MyFunc MyLocalFunc


Compiler Error 1306

# Compiler Error 1306

declaration error:  Declaration type can only be used globally: '\<identifier\>'

I/O declarations must be defined globally;  they cannot be declared as local variables inside of a function or library file.

The following are examples of this error:

INTEGER i;               // ok

STRING str[100];         // ok

DIGITAL_INPUT di;        // ok

DIGITAL_OUTPUT do;       // ok

ANALOG_INPUT ai;         // ok

ANALOG_OUTPUT ao;        // ok

STRING_INPUT si[100];    // ok

STRING_OUTPUT so;        // ok

BUFFER_INPUT bi[100];    // ok

FUNCTION MyFunc()

{

   INTEGER i;            // ok – not an I/O declaration

   STRING str[100];      // ok – not an I/O declaration

   DIGITAL_INPUT di;     // error

   DIGITAL_OUTPUT do;    // error

   ANALOG_INPUT ai;      // error

   ANALOG_OUTPUT ao;     // error

   STRING_INPUT si[100]; // error

   STRING_OUTPUT so;     // error

   BUFFER_INPUT bi[100]; // error

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1306


Compiler Error 1307

# Compiler Error 1307

declaration error:  Variables must be declared before array

                                     declarations: '\<identifier\>'

I/O declarations must be declared in a specific order.  All arrays of an I/O declaration type (i.e.: DIGITAL_INPUT) must be declared after any variables of the same type.

The following are examples of this error:

DIGITAL_INPUT di1, di2;   // ok

DIGITAL_INPUT di3;        // ok

ANALOG_INPUT ai1          // ok

DIGITAL_OUTPUT do1;       // ok

ANALOG_INPUT aiArr1[10];  // ok

DIGITAL_INPUT di4;        // ok – no DIGITAL_INPUT array exists yet

DIGITAL_INPUT diArr1[10]; // ok

DIGITAL_OUTPUT do2;       // ok

ANALOG_INPUT aiArr2[20];  // ok – multiple arrays are allowed

DIGITAL_INPUT di5;        // error – cannot define after diArr1

ANALOG_INPUT ai2;         // error – cannot define after aiArr2

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1307


Compiler Error 1308

# Compiler Error 1308

declaration error:  Declaration cannot be declared in library file: '\<identifier\>'

I/O declarations, Parameters and global variables can only be defined in a SIMPL+ module (.usp file).  Libraries files (.usl files) are files that only contain functions.  Local functions variables, function arguments and functions that return values are permitted within library files.

The following are examples of this error:

//////////////////////////////////////////////////////////////////

//  MyLib.usl

INTEGER x;                              // error – x is global

STRING str[100];                        // error – str is global

DIGITAL_INPUT di;                       // error – di is global

INTEGER_PARAMETER intParam;             // error – intParam is

                                        //         a Parameter

FUNCTION MyFunc()

{

   INTEGER i, j;                        // ok – i and j are local

   STRING str[100];                     // ok – str is local

}

INTEGER_FUNCTION MyIntFunc( INTEGER x ) // ok – x is local

{

   INTEGER i, j;                        // ok – i and j are local

   STRING str[100];                     // ok – str is local

   return (x);

}

STRING_FUNCTION MyStFunc( STRING s )    // ok – s is local

{

   INTEGER i, j;                        // ok – i and j are local

   STRING str[100];                     // ok – str is local

   return (str);

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1308

Compiler DIGITAL_INPUT Error FUNCTION INTEGER INTEGER_FUNCTION INTEGER_PARAMETER MyFunc MyIntFunc MyStFunc STRING STRING_FUNCTION


Compiler Error 1309

# Compiler Error 1309

declaration error:  Compiler Directive must be set before all global

                                      variable declarations

                                 #DEFAULT_NONVOLATILE Compiler Directive already set

                                 #DEFAULT_VOLATILE Compiler Directive already set

The compiler directives, #DEFAULT_VOLATILE and #DEFAULT_NONVOLATILE, must be used before any global variables are encountered within the SIMPL+ module.  A module cannot contain more than one of these directives.

The following are examples of this error:

//////////////////////////////////////////////////////////////////

// Example 1

#DEFAULT_VOLATILE     // ok – compiler directive exists before

                      //      all global variables

INTEGER x;

STRING str[100];

DIGITAL_INPUT di;

FUNCTION MyFunc()

{

}

//////////////////////////////////////////////////////////////////

// Example 2

INTEGER x;

STRING str[100];

DIGITAL_INPUT di;

#DEFAULT_VOLATILE     // error – global variables have already been

                      //         declared within this module

FUNCTION MyFunc()

{

}

//////////////////////////////////////////////////////////////////

// Example 3

#DEFAULT_VOLATILE     // ok – compiler directive exists before

                      //      all global variables

INTEGER x;

STRING str[100];

DIGITAL_INPUT di;

#DEFAULT_NONVOLATILE  // error – #DEFAULT_VOLATILE has already

                      //         been set

INTEGER y;

#DEFAULT_NONVOLATILE  // error – #DEFAULT_VOLATILE has already

                      //         been set

INTEGER z;

FUNCTION MyFunc()

{

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1309

Compiler DEFAULT_NONVOLATILE DEFAULT_VOLATILE DIGITAL_INPUT Error FUNCTION INTEGER MyFunc STRING


Compiler Error 1310

# Compiler Error 1310

declaration error:  Compiler directive cannot be in function scope

Compiler directives cannot be used locally within functions.  They can only be used at a global level and the directive applies to the entire SIMPL+ module.

NOTE: Scope refers to the level at which an Event, user-defined function or statement resides.  Having a global scope means that the function or variable can be called or accessed from anywhere within the program.  A local scope means that the variable can only be accessed from within the event or function that it resides in.

The following are examples of this error:

#DEFINE_CONSTANT   MyConst   100         // ok – used globally

#USER_LIBRARY “MyUserLib”                // ok – used globally

FUNCTION MyFunc()

{

   #DEFINE_CONSTANT   AnotherConst   100 // error – constants cannot

                                         //         be used locally

   #USER_LIBRARY “AnotherUserLib”        // error – libraries cannot

                                         //         be included locally

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1310

Compiler DEFINE_CONSTANT Error FUNCTION MyFunc


Compiler Error 1311

# Compiler Error 1311

declaration error:  Undefined Wait Label: '\<identifier\>'

                                 Missing, invalid or already defined Wait label: '\<identifier\>'

Wait Statements can be given a label as an optional argument.  This label must be  a unique name and more than one wait statement cannot share the same label name.  The label name can then be used in the Pause, Cancel and Resume wait functions.  All labels must already be declared in within a wait statement before any Pause, Cancel or Resume wait statement can reference it.

The following are examples of this error:

FUNCTION MyFunc()

{

   CancelAllWaits();               // ok

   CancelWait( MyWaitLabel );      // error – MyWaitLabel has

                                   //         not been declared yet

   Wait( 500 )                     // ok – Label is not required

   {

   }

   Wait( 500, MyWaitLabel )        // ok – MyWaitLabel is unique

   {

   }

   Wait( 500, MyWaitLabel )        // error – MyWaitLabel has already

                                   //         been used

   {

   }

   CancelWait( AnotherWaitLabel ); // error – AnotherWaitLabel has

                                   //         not been declared yet

   Wait( 500, AnotherWaitLabel )   // ok – AnotherWaitLabel is unique

   {

   }

   CancelWait( AnotherWaitLabel ); // ok

   PauseWait( MyWaitLabel );       // ok

   ResumeWait( MyFunc );           // error – MyFunc is not a valid

                                   //         wait label

   ResumeWait( someLabel );        // error – someLabel does not exist

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1311

CancelAllWaits CancelWait Compiler Error FUNCTION MyFunc PauseWait ResumeWait Wait


Compiler Error 1312

# Compiler Error 1312

declaration error:  Array boundary exceeded maximum size of ‘num_bytes’ bytes

The maximum number of indices for an array is 65535.

The following are examples of this error.

FUNCTION MyFunc()

{

   INTEGER int[100], intArr[100][100]; // ok

   STRING str[100], strArr[100][100];  // ok

   INTEGER int[100000];                // error

   INTEGER intArr[100000][100];        // error

   INTEGER intArr[100][100000];        // error

   STRING str[100000];                 // error

   STRING strArr[100000][100];         // error

   STRING strArr[100][100000];         // error

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1312


Compiler Error 1313

# Compiler Error 1313

declaration error:  Minimum array size invalid

The minimum array size cannot exceed the total size of the array.  The minimum array size must be between 1 and the total size of the array.

The following are examples of this error:

DIGITAL_INPUT digIn1[10];     // ok

DIGITAL_INPUT digIn2[10,5];   // ok – minimum size is 5

ANALOG_INPUT anlgIn3[10,0];   // error – minimum size must be

                              //         greater than 0

STRING_INPUT strIn4[10,20];   // error – minimum size of 20 exceeds

                              //         total array size of 10

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1313


Compiler Error 1314

# Compiler Error 1314

declaration error:  Minimum array size is not allowed for this

                                      datatype: '\<identifier\>'

                                   Minimum array size for this datatype has already

                                      been declared: '\<identifier\>'

Minimum array sizes are only applicable to Input and Output datatypes (i.e.: DIGITAL_INPUT, ANALOG_OUTPUT, STRING_INPUT, etc.).  A variable of another datatype was found trying to define a minimum array size.  Only one array for each Input or Output datatype is allowed to be declared with a minimum array size.

The following are examples of this error:

DIGITAL_INPUT digIn1[10];    // ok

DIGITAL_INPUT digIn2[10,5];  // ok – minimum size is 5

DIGITAL_INPUT digIn3[20,10]; // error – the DIGITAL_INPUT array

                             //         variable, digIn2, has already

                             //         been declared with a minimum

                             //         array size

ANALOG_INPUT anlgIn1[10];    // ok

ANALOG_INPUT anlgIn2[10,5];  // ok – no other ANALOG_INPUT has been

                             //      declared with a minimum array size

INTEGER x[10];               // ok

INTEGER y[10,5];             // error – INTEGER is not an Input or

                             //         Output datatype

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1314


Compiler Error 1315

# Compiler Error 1315

construct  error:  Socket receive buffer size missing: '\<identifier\>'

The receiving buffer size was not specified within the socket declaration.  All socket declarations must contain a buffer size.

The following are examples of this error:

TCP_CLIENT tcpClient[1024]; // ok

TCP_SERVER tcpServer[1024]; // ok

UDP_SOCKET udpSocket[1024]; // ok

TCP_CLIENT tcpClient2; // error

TCP_SERVER tcpServer2; // error

UDP_SOCKET udpSocket2; // error

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1315


Compiler Error 1316

# Compiler Error 1316

construct  error:  Invalid Parameter Type: '\<identifier\>'.  Expected Types: 'Decimal',

                                 'Time', 'HexAddress', 'Percent', 'Constant'

                                 String Parameters cannot contain a type: '\<identifier\>'

An invalid Parameter Type was specified within a parameter declaration.  Parameter Types are optional when declaring parameter data types and can only be one of the following types:  ‘Decimal’, ‘Time’, ‘HexAddress’, ‘Percent’ or ‘Constant’.  String parameters cannot contain a parameter type.

The following are examples of this error:

INTEGER_PARAMETER intParam; // ok

INTEGER_PARAMETER intParam:Decimal; // ok

INTEGER_PARAMETER intParam:String; // error – String is not a valid parameter type

LONG_INTEGER_PARAMETER longIntParam:Time; // ok

SIGNED_INTEGER_PARAMETER signedIntParam; // ok

SIGNED_LONG_INTEGER_PARAMETER signedLongIntParam; // ok

STRING_PARAMETER strParam; // ok

STRING_PARAMETER strParam:Time; // error – STRING_PARAMETERS cannot // contain a paramter type

STRING_PARAMETER strParam:String; // error – String is not a valid

// parameter type

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1316


Compiler Error 1317

# Compiler Error 1317

construct  error:  Declaration cannot be declared as Nonvolatile: '\<identifier\>'

A variable was found trying to be declared with the NONVOLATILE keyword.

The following are examples of this error:

NONVOLATILE DIGITAL_INPUT di; // error

NONVOLATILE TCP_CLIENT tcpClient[1024]; // error

NONVOLATILE TCP_SERVER tcpServer[1024]; // error

NONVOLATILE INTEGER i; // ok

NONVOLATILE INTEGER str[10]; // ok

VOLATILE UDP_SOCKET udpSocket[1024]; // ok – VOLATILE is the

                                              //      default type

VOLATILE DIGITAL_INPUT di; // ok

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1317

Compiler DIGITAL_INPUT Error INTEGER NONVOLATILE VOLATILE


Compiler Error 1318

# Compiler Error 1318

construct  error:     Invalid Parameter Property Value or Property Value not allowed for \<parameter\>

Invalid Parameter Property Value (Numeric value expected)

Invalid Parameter Property Value (String expected)

A parameter was being assigned a value that was either out of range or of the wrong type for the parameter specified.  Numeric values can only be assigned to non-String_Parameters with propValidUnits containing one of the following types:  unitDecimal, unitHex, unitPercent, unitCharacter, unitTime or unitTicks.  String values can only be assigned to a String_Parameter and with propValidUnits=unitString.

The following are examples of this error:

INTEGER_PARAMETER intParam;

STRING_PARAMETER strParam;

#BEGIN_PARAMETER_PROPERTIES intParam    specified

   propValidUnits = unitDecimal; // ok

   propValidUnits = unitString; // error – intParam is not

                                           a string

   propDefaultValue = “abc”; // error – number expected

   propDefaultValue = 5d; // ok

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES strParam

   propValidUnits = unitDecimal; // error – strParam is not

                                            a number

   propValidUnits = unitString; // ok

   propDefaultValue = “abc”; // ok

   propDefaultValue = 5d; // error

#END_PARAMETER_PROPERTIES

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1318


Compiler Error 1319

# Compiler Error 1319

construct  error:     Invalid format specifier: \<format specifier\>,  propValidUnits undefined or specifier not declared within propValidUnits

Specifier not declared within propValidUnits

A parameter was being assigned a value that was either out of range or of the wrong type.  Before any property or property value can be defined, propValidUnits must be specified.  The PropDefaultUnit specified must be contained within propValidUnits.

The following are examples of this error:

INTEGER_PARAMETER intParam;

#BEGIN_PARAMETER_PROPERTIES intParam

   propBounds = 25d, 50d;  // error – propValidUnits undefined

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES intParam

   propValidUnits = unitDecimal;

   propBounds = 25d, 50d;  //ok – propValidUnits defined above

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES intParam

   propValidUnits = unitDecimal|unitCharacter;

   propDefaultUnit = unitHex; // error – unitHex not contained

                                         within propValidUnits

   propDefaultUnit = unitCharacter; // ok

   propBounds = 25d, 50d;  // ok – valid Integer range is 0-65535

   propBounds = -50d, -25d;  // error – Integer range is not 0-65535

   propBounds = “abc”, "def"; // error – “abc” is not a valid number

#END_PARAMETER_PROPERTIES

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1319


Compiler Error 1320

# Compiler Error 1320

construct  error:  Cannot combine property unit: \<unit\>

The property unit, unitString, cannot be combined with any other property unit (i.e., unitDecimal,unitCharacter, etc).

The following are examples of this error:

INTEGER_PARAMETER intParam;

STRING_PARAMETER strParam;

#BEGIN_PARAMETER_PROPERTIES intParam

   propValidUnits = unitDecimal|unitCharacter; // ok

   propValidUnits = unitString; // ok

   propValidUnits = unitString|unitDecimal; // error

#END_PARAMETER_PROPERTIES

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1320


Compiler Error 1321

# Compiler Error 1321

construct  error:  Dynamic variable declarations cannot be used with the

   #DEFAULT_NONVOLATILE compiler directive

The declaration keyword, Dynamic, can only be used when #DEFAULT_VOLATILE is specified for the program module.

The following are examples of this error:

// MODULE A

#DEFAULT_NONVOLATILE

dynamic integer intArr[10]; // error

// MODULE B

dynamic integer intArr[10]; // error – #DEFAULT_NONVOLATILE is the

   default state for this module

// MODULE C

#DEFAULT_VOLATILE

dynamic integer intArr[10]; // ok

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1321


Compiler Error 1322

# Compiler Error 1322

construct  error:  Variable cannot be declared as dynamic: \<variable\>

The declaration keyword, Dynamic, can only be used with string or array declarations.  I/O declarations are not allowed to be declared as dynamic.

The following are examples of this error:

#DEFAULT_VOLATILE

dynamic integer i; // error – ‘i’ is not an array

dynamic string_input si // error – I/O declarations are not

permitted

dynamic integer intArr[10]; // ok

dynamic string str[10]; // ok

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1322


Compiler Error 1323

# Compiler Error 1323

construct  error: #ENABLE_DYNAMIC compiler directive must be used when

                                    using declaring variables dynamically

In order to declare Strings and Arrays dynamically, the compiler directive, #ENABLE_DYNAMIC, must be specified beforehand within the module.

Dynamic memory allocation is the allocation of a variable’s memory at run-time.  The amount of memory allocated is determined by the program at the time of allocation and need not be known in advance.

Using Dynamic variables allows a String or Array variable’s memory allocation to grow or shrink in size.  Rather than initially declare a String or Array variable to some large amount, the variable can be dynamically resized to the correct amount in real-time.

NOTE:  Dynamic variables are specific to Firmware versions 4.000 and later

The following are examples of this error:

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /

// Example 1

#ENABLE_DYNAMIC

DYNAMIC STRING str[10]; // ok, #ENABLE_DYNAMIC

                        // declared at top of module

FUNCTION foo()

{

   SIGNED_INTEGER status;

   DYNAMIC INTEGER arr[10][10]; // ok, #ENABLE_DYNAMIC

                                // declared at top of module

   status = ResizeString( str, 100 );

   status = ResizeArray( arr, 200, 100);

}

//////////////////////////////////////////////////////////////////////////

// Example 2

DYNAMIC STRING str[10]; // error, #ENABLE_DYNAMIC not

                        // declared at top of module

FUNCTION foo()

{

   SIGNED_INTEGER status;

   DYNAMIC INTEGER arr[10][10]; // error, #ENABLE_DYNAMIC not

                                // declared at top of module

   status = ResizeString( str, 100 );

   status = ResizeArray( arr, 200, 100);

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1323

Compiler ENABLE_DYNAMIC Error FUNCTION INTEGER ResizeArray ResizeString SIGNED_INTEGER STRING


Compiler Error 1324

# Compiler Error 1324

declaration error: propList cannot be used in conjunction with propBounds.

                                  propBounds cannot be used in conjunction with propList.

NOTE: propList and propBounds cannot be used within the same parameter properties block.

The following are examples of this error:

INTEGER_PARAMETER iParam, iAnotherParam;

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propBounds = 10,20; // ok

   propList = {10d, "value1"}, {20d, "value2" }; // error -

                                 // propBounds previously used

                                 // within block

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propList = {10d, "value1"}, {20d, "value2" }; // ok

   propBounds = 10,20; // error -

                       // propList previously used

                       // within block

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propList = {10d, "value1"}, {20d, "value2" }; // ok

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propBounds = 10,20; // ok

#END_PARAMETER_PROPERTIES

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1324


Compiler Error 1325

# Compiler Error 1325

declaration error: propDefaultValue must be declared before using propList.

                               propBounds must be declared before using propDefaultValue.

                               propList must contain an element with the propDefaultValue.

Default values, if specified, must be specified before a propList declaration.  If using propBounds, the Default Value must be defined beforehand.  If a default value is specified, the propList must contain at least one element that contains this default value.

The following are examples of this error:

INTEGER_PARAMETER iParam, iAnotherParam;

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propBounds = 10d,20d; // ok

   propList = {10d, "value1"}, {20d, "value2" }; // error -

                                 // propBounds previously used

                                 // within block

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propDefaultValue = 15d; // ok

   propBounds = 10d,20d; // ok

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propDefaultValue = 15d;// ok

   propBounds = 10d,20d; // error – propDefaultValue has been

                         // defined beforehand

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propDefaultValue = 15d;// ok

   propList = {10d, "value1"}, {20d, "value2" }; // error –

                          // propDefaultValue has been

                          // defined beforehand

#END_PARAMETER_PROPERTIES

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1325


Compiler Error 1326

# Compiler Error 1326

declaration error: propDefaultValue is not within propBounds.

                                  propBound's Upper Bound value must be greater than the

                                  Lower Bound value

                                  propBound's Lower, Upper and Default values must be of the same

                                  type

The Default Value must be within the bounds specified in propBounds.  The compiler will also enforce that the lower bound is less than the upper bound.  All values specified must also be of the type indicated within propValidUnits.

The following are examples of this error:

INTEGER_PARAMETER iParam, iAnotherParam;

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propDefaultUnit = unitDecimal;

   propBounds = 1d,20d; // ok, 1d and 20d are both of type

                        // unitDecimal.

   propDefaultValue = 10d;// ok, 10d is within 1d and 20d and

                          // of type unitDecimal.

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propDefaultUnit = unitDecimal;

   propBounds = 1d,20d;

   propDefaultValue = 50d; // error, 50d is NOT within 1d and 20d

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propDefaultUnit = unitDecimal;

   propBounds = 50d,20d; // error – 50d is not less than 20d

#END_PARAMETER_PROPERTIES

#BEGIN_PARAMETER_PROPERTIES iParam, iAnotherParam

   propValidUnits = unitDecimal;

   propBounds = 50t,20t; // error – 50t is not of type unitDecimal

#END_PARAMETER_PROPERTIES

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1326


Compiler Error 1327

# Compiler Error 1327

dconstruct  error: Nonvolatile variables cannot be resized:  \<variable\>

Variables that are declared as volatile are only allowed to be resized.  Either the global compiler directive, #VOLATILE, or the declaration modifier, “VOLATILE”, may be used to declare a variable as volatile.

The following are examples of this error:

#DEFAULT_NONVOLATILE

integer intArr[10];

nonvolatile int2dArr[10][20];

nonvolatile string str[100];

volatile myIntArr[10];

volatile myStr[100];

function MyFunc()

{

   ResizeArray( intArr, 100 );  // error – intArr is declared as nonvolatile by default;

   ResizeArray( int2dArr, 15, 25 );  // error – int2dArr is nonvolatile

   ResizeString( str, 200 ); // error – str is nonvolatile

   ResizeArray( myIntArr, 20 ); // ok – myIntArr is volatile

   ResizeString( myStr, 200 ); // ok – myStr is volatile

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1327

Compiler DEFAULT_NONVOLATILE Error MyFunc ResizeArray ResizeString VOLATILE


Compiler Error 1328

# Compiler Error 1328

declaration  error: Encoding Types are only valid for STRING declarations

Encoding only applies to strings.  The declaration modifiers, ASCII, UTF16 and INHERIT can only be used with variables of type STRING.

The following are examples of this error:

ASCII string str[100]; // ok – str is of type ‘string’

UTF16 integer myIntArr[10]; // error – myIntArr is of type ‘integer’

INHERIT string myStr[100]; // ok – myStr is of type ‘string’

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1328


Compiler Error 1329

# Compiler Error 1329

**declaration error:   Class name exists in one or more namespaces. **

**                                     Fully-qualified name must be specified: ‘\<class_name\>’**

SIMPL# Libraries can contain multiple namespaces, each of which can contain one or more classes. Class names do not have to be unique when used in different namespaces. For example, namespaceA and namespaceB can each contain a class named, ‘MyClass’.

Using the example above, if SIMPL+ were to declare a variable of type, ‘MyClass’, the compiler would not know which namespace to use and would result in an ambiguous declaration. For SIMPL+ to resolve this error, the fully-qualified name must be specified.

Fully-qualified names are represented by specifying both the namespace and class name, using the dot-notation to separate them. The SIMPL+ declaration would be: ‘namespaceA.MyClass \<variable_name\>’.

The following are examples of this error:

SIMPL# Library

// SimplSharpLibrary.clz

namespace MyNamespace1

{

   public class MyClass

   {

        public int intVar();

   }

}

namespace MyNamespace2

{

   public class MyClass

   {

        public int intVar();

   }

}

SPlusModule.usp

// UserModule.usp

#USER_SIMPLSHARP_LIBRARY "SimplSharpLibrary"

MyClass class1;               // error – compiler doesn’t know

                                 whether MyClass is from

                                 MyNamespace1 or MyNamespace2

MyNamespace1.MyClass class1;  // ok – fully-qualified name is used

MyNamespace2.MyClass class2;  // ok – fully-qualified name is used

FUNCTION MyFunc()

{

   Class1.intVar = 1;      // ok – use SIMPL+ variable as normal

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1329


Compiler Error 1400

# Compiler Error 1400

assignment error:  Illegal Assignment

Assignments in SIMPL+ require that the value being assigned to a variable must equate to the same type as that variable.  Integer variables can only be assigned integer values and string variables can only be assigned a string value.

- If a complex assignment is being made, make sure that all parenthesis are matched.  In other words, all opening parenthesis must have a matching closing parenthesis.

- When comparing 2 strings (‘=’, ‘\<’, ‘\>=’, etc.), the resulting value is an integer

- Input variables (DIGITAL_INPUT, ANALOG_INPUT, STRING_INPUT and BUFFER_INPUT) cannot be assigned a value.

The following are examples of this error:

INTEGER x, y;

STRING str[100], str2[100];

DIGITAL_INPUT digIn;

DIGITAL_OUTPUT digOut;

ANALOG_OUTPUT anlgOut;

FUNCTION MyFunc()

{

   str = “abc”;                // ok

   str = “abc” + “def”;        // ok

   str = str2;                 // ok

   x = 1;                      // ok

   x = digOut;                 // ok

   x = (str = str2);           // ok

   x = 5 \* (1 + (str \> str2)); // ok

   digOut = x;                 // ok

   digOut = 5;                 // ok

   digOut = anlgIn;            // ok – both are integer types

   x = str;                    // error – str does not equate to

                               //         an integer

                               //         atoi() should be used

   digIn = 1;                  // error - digIn is an input variable

   str = 5;                    // error – 5 is an integer

                               //         MakeString() should be used

   str = str2 = “abc”;         // error = str2 = “abc” is an equality

                               //         test, not an assignment

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1400


Compiler Error 1401

# Compiler Error 1401

assignment error:  Variable cannot be used for assignment:  '\<identifier\>'

Function arguments that have been declared as ReadOnlyByRef can only have their values read;  values cannot be assigned to them.

The following are examples of this error:

FUNCTION MyFunc( INTEGER x, ReadOnlyByRef INTEGER y )

{

   x = 5; // ok

   x = y; // ok – the value of y can be read

   y = 6; // error – y is read-only

}

Language Constructs & Functions
Compiler Errors & Warnings
Compiler Error 1401