Calculation helpful hints, About protected calculations – MTS Series 793 User Manual

Page 354

Advertising
background image

Description

Item

You must Apply or Cancel edits before switching to a different
calculation.

Cancels any changes made in the formula and returns formula values
to where they were when Apply was last clicked or the calculation
initially loaded.

Cancel

Removes the formula from the Expression box.

Clear

Calculation Helpful Hints

All calculations are performed in system units.

The compiler does not perform optimization. All operations that are specified are executed. This includes
implicit conversions. For example, in the following code, the second assignment is more efficient than the
first, because the first one needs to convert the integer zero into floating-point. The following code is generated
to do this:

real x; x = 0; x = 0.0;

If implicit type conversion is used in a calculation, a warning is posted indicating the line and ending column
of the offending part of the calculation. However, the calculation will still compile and run as long as no errors
are present. To prevent these warnings, explicit type conversion may be performed using the function style
syntax of int(expression) or real(expression).

If you have several calculated signals that need the same expression, except that they operate on different
input signals, then declare a variable at the beginning that is assigned to the input signal. Use this variable
within the rest of the code. Then you can copy the expression to the other calculation signals, and just change
the one line to point to the different signal.

Use variable names that help document their use. By convention, use quotes around signal and parameter
names, but define internal variables so they do not need quotes.

Put comments, white space, and line terminators in the code to make it more readable for the next person.
These have no impact on performance.

Make sure you initialize any variables defined in user-defined functions. The compiler will not find this error
for you.

About Protected Calculations

Note:

By default, the calculation protection feature is disabled. To enable this feature, contact your MTS
representative.

Model 793.00 System Software includes a custom calculation protection feature. This feature allows you to
protect selected calculations with a password so you can control their access and protect the intellectual
property they represent.

User interface changes to the Calculation Editor

Once this feature is enabled, the Calculation Editor is equipped with an additional toolbar button (displaying
a lock icon) and a “Protect this expression” check box.

354 MTS Series 793 Control Software

Calculated Signals

Advertising