Skip to main content
InSource Solutions

TN WW167 Wonderware QuickScript vs QuickScript.NET

Description

 

This article from InSource shows a high-level comparison between Wonderware's two languages QuickScript and QuickScript.NET

  • Author: Dillon Perera
  • Published: 12/26/2016
  • Applies to: Wonderware QuickScript and QuickScript.NET

Details

Depending on what Wonderware product you are using you may have access to Wonderware's scripting languages called QuickScript or QuickScript.NET.  The two languages are similar, but there are also some large differences between them.

History:

Wonderware QuickScript is the default language used in Wonderware's flagship product called InTouch.  This was a language developed in the early versions of InTouch.  InTouch was first released in 1987 and was designed to be easy to use, especially for plant operators who may have been very unfamiliar with computers.  To help these new users, the QuickScript language was developed to allow for very simple scripts to be written.  

Today, with many engineers being comfortable in programming, a new scripting language is required.  QuickScript.NET is an extension to the original QuickScript language, allowing for more advanced scripting features available in other programming languages.

 

Comparison:

Feature QuickScript QuickScript.NET
Commenting

Comments are allowed.

Comment Blocks can be created using a brace character { to indicate the start of a comment block, and a closing brace } to indicate the end.

Note: Nesting comment blocks should not be done.

Comments are allowed.

Single Line Comments can be created using a single apostrophe character, ', to indicate that everything after that point on the line is a comment.

Comment Blocks can be created using a brace character { to indicate the start of a comment block, and a closing brace } to indicate the end.

Note: Nesting comment blocks should not be done.

 

.

Functions Wonderware provides functions that can be used, such as HTUpdateToCurrentTime().  These functions will be prebuilt into the software and available for use in your scripts.  Additional script functions may be available for download from Wonderware's website, but are unsupported.

Wonderware provides functions that can be used, however they do not provide as many.  One of the biggest differences between QuickScript and QuickScript.NET is the ability to use Microsoft's .NET library of functions.  With QuickScript.NET the user will have access to the vast majority of Wonderware's library, reducing the need for Wonderware to write their own custom functions.

One key benefit to this system is that Microsoft's .NET library is widely used by other programmers, and as such sample scripts can often be found online.  Because the QuickScript.NET language is different that VB or C#, some modifications to online samples would be required.

Try / Catch functionality Wonderware QuickScript language does not allow the Try / Catch functionality.

QuickScript.NET does allow Try/Catch to be used.  This is a powerful feature, allowing errors to be caught and dealt with by the programmer, instead of causing the script to misbehave or not execute. 

The basic format for this is:

TRY

     [Script to attempt]

CATCH

     [What to do if an error occurs]

ENDTRY;

Data Types

QuickScript allows for basic data types of limited size:

Discrete = A boolean, 0 or 1, value

Integer = A whole number value.

Real = A number that can have decimal places.

Message = A string of characters, with a maximum limit of 131 character length.

QuickScript.NET allows for basic data types of limited size:

Boolean= A boolean, 0 or 1, value

Integer = A whole number value.

Double = A whole number value, similar to an Integer but double the size.

Float = A number that can have decimal places.

String = A string of text.

Time = A time

Elapsed Time = The amount of time elapsed between two Time values.

Object = Used for more complex data types, such as .NET objects.