IF Expression for Field Protection - Intergraph Smart Instrumentation - Help

Intergraph Smart Instrumentation Help

Language
English
Product
Intergraph Smart Instrumentation
Search by Category
Help
Smart Instrumentation Version
13.1

Syntax

if (b, t, f)

in which b stands for a Boolean expression, t for true and f for false. You substitute the t and f arguments with 0 and 1. When true, the value of 0 indicates that the field is editable and 1 that the field is protected.

Example 1

In this example, the expression sets the measuring point field calib_set_single_pnt_level as editable in the Tag Calibration Settings window and non-editable (protected) in the Calibration Profile Settings window. The expression does not apply to the Function Check or Switch Set Point calibration types.

if(calib_set_no_pnt=1 and cmpnt_id<>0 and calib_type_id<>2 and calib_type_id<>3,0,1)

The following table describes each expression segment individually.

Expression Segment

Description

calib_set_no_pnt=1

The Number of points field value on the Calibration Settings form is defined as 1.

cmpnt_id<>0

Instrument tag number exists (tag number ID is other than 0).

calib_type_id<>2 and calib_type_id<>3

Calibration type is not Function Check or Switch Set Point.

0,1

editable, protected

  • The cmpnt_id value determines whether the software opens the Calibration Profile Settings window or the Tag Calibration Settings window in the Calibration module. To open profile settings, the software runs an SQL command which includes the following parameter: cmpnt_id=0; whereas, to open calibration settings for an instrument, the software runs an SQL command which includes the cmpnt_id value of that instrument.

  • For details of calibration type ID numbers, see Calibration Type ID Numbers.

Example 2

In this example, the expression sets the measuring point field calib_set_single_pnt_level as editable in the Calibration Data Entry window and non-editable (protected) in the Calibration History window. The expression does not apply to the Function Check or Switch Set Point calibration types.

if(calib_no_pnt=1 and (isnull(calib_hist_flg) or calib_hist_flg='0') and calib_type_id<>2 and calib_type_id<>3,0,1)

The following table describes each expression segment individually.

Expression Segment

Description

calib_no_pnt=1

The Number of points field value on the Calibration Data Entry form is defined as 1.

isnull(calib_hist_flg) or calib_hist_flg='0'

The calib_hist_flg value is NULL or 0.

calib_type_id<>2 and calib_type_id<>3

Calibration type is not Function Check or Switch Set Point

0,1

editable, protected

The calib_hist_flg value determines whether the software opens the Calibration Data Entry or Calibration History window. If the value is '0' or NULL, the software opens the Calibration Data Entry window; whereas, if the value is '1', the software opens the Calibration History window. The calib_hist_flg value is character and not integer; therefore, in the expression, you must enclose the calib_hist_flg value in single quotes.