Variables List - SpecView Variables

<< Click to Display Table of Contents >>

Navigation:  Editing a SpecView Project > Editing GDWs - Graphical Display Windows > Variables List >

Variables List - SpecView Variables

Previous pageReturn to chapter overviewNext page

 

The first Instrument shown in the Variables List is SpecView, these are the variables that exist only in SpecView but have all the same properties as other variables and can be:

•        Logged

•        Included in Recipes

•        Put on Trend charts or Bar Charts

SpecView boolean variables are used as switches to control events in the Strategy Controller.

 

There are two kinds of SpecView variables, Pre-Defined and User:

 

 

SpecView User Variables

SpecView User Variables are variables that exist only in SpecView, not in the connected instruments. They are sometimes called Software Tags or Dummy Gates.

Examples include:

Text variables, which are used for a single line of text that can be changed while in Runtime Mode, such as: 'Batch Numbers', 'Material ID' 'Customer Name'.

Times for timers such as log report start and stop times.

Booleans for automation.

Enum (Enumerated type) to express multiple states, such as: Stopped/Running/Paused.

 The syntax for defining the value is, for example: 1=Stopped;2=Running;3=Paused.

Countup Timer to record durations.

Countdown Timer to set a delay.

 

To define a SpecView Variable click the Variables List tool tb_vars click the New menu and select the type of variable required:

 

VariablesList_UserVarTypes

 

Give the variable a name together with an initial value using the displayed boxes. The initial value is only used when the variable is displayed on the GDW for the very first time, subsequent SpecView runs will use whatever was the last value of the variable. SpecView will save the values of all User Variables when it exits and will restore the values on the next run.

 

It is possible to set a variable to have a specific default value EACH time SpecView Runtime Mode is entered. To do this use the Strategy Controller's Startup eventto do the action 'Parameters: Download Specific Value'.

 

The new variable will be listed under 'User Variables' and grouped by type.  Clicking on the '+' symbols will expand these lists.

The User Variable can now be added to the GDW in the same way as the instrument variables, by dragging it out onto the GDW.

 

To control how values are displayed on the GDW use Dynamic Attributes.

 

User Variables may have a value entered manually from a GDW, or have its value set by a Button Attribute or Strategy Controller Action

 

The Countdown Timer may be written to as a time variable and it will count down from that value.

Note: Countdown Timers are not stopwatches. They have no reset function or start/stop capability. They are always running towards zero from the last value set. They will stop when they reach zero.

They do NOT count when SpecView is not running. When SpecView is re-started they will resume from their last value.

 

In Strategy Controller to do something when the Countdown has finished test for the Countdown Timer being 1 (not zero because then it will trigger each time Runtime mode is started as zero is its default state).

 

To start a Countup Timer set it to 1, it will then commence counting up from 1.

To stop a Countup Timer set it to zero. It is not possible to 'Pause' a Countup Timer directly, however, using a button or the Strategy Controller the value of the Countup Timer can be copied into a Time User Variable to 'pause' it and then copied back into the Countup Timer to 'resume'.

Note: A Countup Timer that has been started WILL continue to count up while SpecView is not running.

 

By default SpecView will save the current values of User Variables on leaving Runtime mode. Either by exiting SpecView, or by going into Edit mode.

There is also a setting: AutoSaveUserVars which can be changed, this is detailed in Preferences.

 

 

To control how values are displayed use Dynamic Attributes.

 

Maximum Values:

Integer Variables - can contain values in the range: -2147483648  to +2147483647

 

Number Variables - can contain values which have the following limits:

Largest positive number: 3.402823466e+38    (3.4E +/- 38 (7 digits))

Smallest positive number: 1.175494351e–38

Significant digits: 6  e.g. 1.23456       (There is further clarification of Decimal Places)

Internally, SpecView uses 15 significant digits to perform math functions.

These limits also apply to negative numbers.

 

Text Variables - can contain up to 32,767 characters.

 

Time Variables - can hold up to a maximum of  +/- 596523:14:07  (hhh:mm:ss) Time has a resolution of 1 seconds and a max value of   2147483647  seconds, or 68 years

 

TimeMS Variables - have a resolution of 1ms and a max value of  +/- 2147483.647 seconds, which is 596:31:23.647 or  just 24.8 days.

 

TimeMS came about because some instruments return that type - for example, a programmer instrument running in seconds might have a sub-second Segment Time Remaining.

 

In general, the Time one is more useful, but if you need sub-second resolution then TimeMS is your thing.  Maybe you could be calculating average cycle times that need the odd 0.5 seconds in there?

 

 

There are two things to note about TimeMS:

1. The three millisecond digits are NOT enabled by default. To enable them edit SETTINGS.INI and in the [RUNTIME] section of that file there is:

 MillisecondDecimals=0

Change this to 3.

 

2. Once the three millisecond digits are enabled as above, the display of them can be controlled by using Dynamic Attributes.

 

 

Countdown and Countup Variables - the limits for these are the same as for Time variables above.

 

Date Variables - can hold dates up to the 19th January 2038.

 

DateTime Variables - can hold dates and times up to 03:14:07 on 19th January 2038.

 

SpecView User Variable Names

Enter a name for the User Variable

It can be any length (up to 32,767 characters) but shorter names are more manageable

 

VariablesList_VariableNameBox

 

Use the Keyboard button to get an on-screen keyboard.

 

To set an initial default value for a User Variable:

While Screen Values are disabled on the Online Features menu in Edit Mode:

In this case the Properties will have an Initial Value tab. Select the variable, and click Properties, or choose Properties from the popup-menu, and click the Initial Value tab to set it.

 

While Screen Values are enabled on the Online Features menu in Edit Mode:

In this case the 'initial value' has no meaning.

 

Variables List will have a 'V' (Values) column, therefore right click on the value in the Variables List to set it.

 

Boolean default value box

Note: You can change the names of the boolean states from 'On'/'Off' to something more logical for your application (for example 'Open'/'Closed') by using the Properties of the defined variable.

 

Date and DateTime User Variables

Date and DateTime User Variables can have the current computer date and time copied to them by using the Parameters: Download Specific Value button action in a Button Attribute or Strategy Controller Action