ERROR!

This web site requires Java Script.
You must enable Java Script on
your browser to navigate this site.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Variables

A Variable is a user defined storage object that is hidden from normal view but can be used in any mathematical formula, logical expression, or even the setup boxes of various ModCom objects and functions. The value of these variables can be set by using a typical Math Conversion function, or it can be the target of any function that sends a response to an object.

To create or edit an existing Variable, select "Variables" in the <Run-Loop> menu which will bring up the Variable List dialog box. The following is a summery of the options available in this dialog box:

Variable List Dialog Box:

Selection List: This is the list of current Variables if any have been created. This field will be blank if you have not yet defined any Variables for this project.

Modify:

New: Click on this button to add a new Variable to the project. This will bring up another dialog box which can be used to create the specific properties of the Variable. See "Variable Configuration" below for more details.

Edit: To use this option, a Variable must first be selected from the list at the left. Click on this button to edit the selected Variable. This will bring up another dialog box which can be used to edit the specific properties of the Variable. See "Variable Properties" below for more details.

Delete: To use this option, a Variable must first be selected from the list at the left. Click on this button to delete the selected Variable from the project.

Copy: To use this option, a Variable must first be selected from the list at the left. Click on this button to copy the selected Variable and place it on the clipboard. This will then enable you to open another project and paste this Variable into it.

Paste: To use this option, a Variable must first be copied and placed on the clipboard. Click on this button to paste the current contents of the clipboard into the project.

Variable Properties Dialog Box:

Object ID Label: Type in a label that will be used for identification by other objects within ModCom when using this Variable.

Object Format: Use this box to select the operational format of the variable. This can be a Number which can include a decimal point if needed, a Text string which allows it to store both numerical and non-numerical characters (see "Number vs Text" below), a Counter which will operate in the same fashion as an Event Counter on the screen, or a Timer which will operate in the same fashion as an Event Timer on the screen and is listed in seconds including 2 digits to the right of the decimal point.

Decimal Point: If the Data Format is set to "Number", use this box to set the number of digits to the right of the decimal point for the data stored in the Variable. At any time this Variable is the target of a Math Conversion function, the results will be rounded off to the decimal point position entered here.

Reset when start/stop run loop: Check this box if wishing the Variable to reset when starting or stopping the main run-time loop. If unchecked, the Variable will hold its value between run sessions and if the project is saved prior to closing it, the current value will be saved along with the project and then be reloaded the next time the project is opened. Note, the reset value will equal zero if the Data Format is set to "Number", or an empty string if the Data Format is set to "Text".

Data Limitations and Overflow:

Any Variable which uses a "Number" format incorporates a 32-bit signed integer to store its' value. Therefore, the maximum value that these Variables can hold will be between -2,147,483,647 to 2,147,483,647 prior to inserting the decimal point. If this limit is exceeded, an overflow will occur and the word "Overflow" will be stored in the Variable instead of a number. Once this occurs, any subsequent operation which uses this Variable in a mathematical formula will also result in an overflow. To clear the overflow condition, the Run-Loop can be stopped and restarted which will reset any overflow Variables to zero, or the Variable can be assigned a new value using a Math Conversion function, for instance.

Number vs Text:

If the Data Format is set to "Number", transmitting a command to a DAQ Module and sending the response to this Variable will automatically strip off any leading non-numerical characters such as the header character and/or channel number character in the same way as sending it to a Data Window or Instrument Gauge. In contrast, setting the Data Format to "Text" will retain any non-numerical characters in the same way as sending it to a Text Window. Note, any Variable or Screen Object which contains non-numerical characters can not be used in a mathematical formula.