Chapter 3 |
SIMPL# Libraries can expose namespaces, structure definitions, and classes to a SIMPL+ Module . A class in a SIMPL# Library can expose variables, functions and properties. Only functions and variables that have matching SIMPL+ datatypes can be exposed to a SIMPL+ module. All other functions and variables are not available to be used outside of the SIMPL# Library.

Datatypes:
The datatypes that can be exposed to SIMPL+ are contained in the following table:
SIMPL# Datatype | Equivalent SIMPL+ Datatype | Can declare in SIMPL# Library | Can declare in SIMPL+ Module | Array Support |
string | STRING | YES | YES | 1D |
SIMPLSharpString | STRING | YES | NO | 1D |
int | SIGNED_LONG_INTEGER | YES | YES | 1D, 2D |
uint | LONG_INTEGER | YES | YES | 1D, 2D |
short | SIGNED_INTEGER | YES | YES | 1D, 2D |
ushort | INTEGER | YES | YES | 1D, 2D |
struct | STRUCTURE | YES | YES | 1D |
class | CLASS | YES | NO | 1D |
SIMPL# Function Return Type | Equivalent SIMPL+ Return Type | SIMPL+ Datatype (Function) |
string | STRING | STRING_FUNCTION |
SimplSharpString | STRING | STRING_FUNCTION |
int | SIGNED_LONG_INTEGER | SIGNED_LONG_INTEGER_FUNCTION |
uint | LONG_INTEGER | LONG_INTEGER_FUNCTION |
short | SIGNED_INTEGER | SIGNED_INTEGER_FUNCTION |
ushort | INTEGER | INTEGER_FUNCTION |
<user_class> | <user_class> |
|
Note: Modules targeted for 3-Series control system support nested structures and classes.
Classes and structures defined within SIMPL# Libraries can be derived from a base structure or class.
NOTE: SIMPL+ STRING arrays cannot be passed to your SIMPL# module..
The following code is an example classes and structures declared in the of SIMPL# Library below:
namespace SIMPLSharpLibrary1 { public struct tagBaseLibStruct { public string buf; public SimplSharpString simplSharpStr; public int i; public int[] arr; } public struct tagLibStruct { public tagBaseLibStruct baseLibStruct; public int j; } public class baseClass { public baseClass() { } public int baseClassInt; public void baseClassFn() { } } public class Class1 : baseClass { public tagLibStruct libStruct; public int x; public SimplSharpString str; public int classFn() { return 0; } } }

![]() |
Copyright (C) 2013 to the present, Crestron Electronics, Inc. All rights reserved. No part of this work may be reproduced in any form, machine or natural, without the express written consent of Crestron Electronics.