PGM SITEMAP

From SysCAD Documentation

(Redirected from PGMs)
Jump to: navigation, search
PGM LANGUAGE
Introduction The built in programing language referred to as a PGM (Programmable Module) is often used to extend the functionality of SysCAD models. It is used by the General Controller Model and can be edited with any text editors. The PGM syntax is similar to other programing languages like VB.
Variable Declaration
Data Types VALID TYPE ARE: BIT, BYTE, INTEGER, LONG, REAL, DOUBLE, STR, STRING, MEMO
Variable Status Declared variables can be: Read/write enabled * , read only @, concealed @@; with Engineering units - eg:("Qm","t/h") and range limits <Min, Max>.
Labels PageLabel()- used to add tabs to the PGM access window, TextLabel() - used to add description to the PGM access window
PGM Programming and Conventions
PGM Syntax Semicolon(;) marks the comments;
Dollar Sign($) or EndFile will mark the End of the file.
>>filename can be used to load in another PGM file to be used as part of file.
Predefined Variables True, False, Pi, NAN, Onstart, Oninitialise, Onterminate, SolveMode, ModelTag, StopSimulation and PauseSimulation
Operators Arithmetic Operators, Logical Operators, Comparison Operators and Bitwise Operators
Keywords & Functions
SysCAD GetTag Functions Variable = GetTag("SysCAD Tag")
Variable = GetDynTag("SysCAD Tag")
String = GetDynStrTag("String")
SysCAD SetTag Functions SetTag("SysCAD Tag", value)
SetDynTag("SysCAD Tag", value)
SetDynStrTag(String, String2)
Defining a Function Function, Return, EndFunct
StrFunction, Return, EndFunct
Keywords & Predefined Functions If Statements: If, ElseIf, Else, Endif ; IIf()
While Statements: While, Endwhile
Conversions: Cnv(), CnvVal(), CnvInfo()
Watch Keywords: Watch(), ExcludeWatch(), SetConcealed, SetConceledState
Time Keywords: Time(), DeltaTime()
Random(), Beep()
Displaying Messages: LogError(), LogNote(), ConditionError(), ConditionNote(), MsgBox()
Math Functions Sin, Cos, Tan, ATan2, Abs, Sqrt, Exp, Ln, Log, Pow, Max, Min, Range, Trunc, Round, Roundup, Mod, Div, IsNAN
String Functions StrCat, StrStr, StrCmp, StriCmp, Left, Right, Mid, StrLen, StrUpr, StrLwr, IntToStr, IntStr, FltToStr, FltStr, StrToInt, StrToFlt, Trim, TrimWhiteSpace
Classes
Defining a Class Syntax: Class, Endclass
Predefined Classes Specie Database Class, Array Class, Matrix Class, Noise, TimeClass
OTHERS
Examples Example PGM Files
Mathematical Function Examples
String Function Examples
Frequently Asked Questions Some frequently asked questions and answers.
PGM Error Codes This gives some explanation for the error codes used by SysCAD when reporting problems with PGM file syntax.
Personal tools
Document Sections