Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Measurement Advisor

[dbo]​.[writeReadingRawIrr] stored procedure

  • Last UpdatedJun 20, 2025
  • 8 minute read

The input Application Programming Interface (API) writeReadingRawIrr is used to input meter data into the EFM database for irregular meters.

This data will also be copied into the rdm_ReadingAuditIrr table, where a copy of the unprocessed data will be kept for audit purposes. Any data that is incomplete or invalid will be moved to the rejected reading table (sys_ReadingRejectedIrr) for the user to evaluate. It is possible to view the already processed data in the Meter Summary from within the AVEVA Measurement Advisor client.

Internal Field (Parameter) Name

Field req'd?

Data Type (alias, SQL data type)

Description

@objName

Y

T_nameType, nvarchar(32)

@objName is the name of the meter. This value will be checked against the meterName in the meterDefine table. If the system has the CD_CONTACT module enabled and the @orgName is provided, the system will consider the @objName to be the externally known name and lookup the name internal to AVEVA Measurement Advisor. For example, the organization 'Big Corp' calls our meter '12345-01' by the name 'FHILLS01'. In this case, the orgName is 'Big Corp' and the objName is 'FHILLS01'. The system will use this to look up that the internal name is '12345-01'. orgName will be compared to the column organizationName in the organizationDefine table. The objName will be checked against the aliasName column in the objectOrgAlias table for objects of type Meter. If the @objName is not found, the meter data will be rejected.

@orgName

N

T_nameType, nvarchar(32)

@orgName will be compared to the column organizationName in the organizationDefine table. The @orgName is used when looking up the meter alias. If the meter alias is not found, the meter data will be rejected.

@startTime

Y

T_dateTimeType, datetime

The start time of the irregular reading. The format must conform to Microsoft SQL Server datetime data type.

@endTime

Y

T_dateTimeType, datetime

The start time of the irregular reading. The format must conform to Microsoft SQL Server datetime data type.

@userName

Y

T_nameType, nvarchar(32)

The name of the user or system that is submitting the meter reading.

@editStateName

N

T_nameType, nvarchar(32)

Default is Observed.

Options are as follows:

  • Manual Override

  • Edited

  • Actualized

  • User Estimate

  • System Estimate

  • Observed

  • Observed Accepted

The provided value will be checked against the column editStateName in the editStateDesc table. If the edit state is not found, the meter data will be rejected.

@unitProfileName

N

T_nameType, nvarchar(32)

Default is NULL. If a value is not provided, the system will retrieve the configured Input Unit Profile for the meter (inputProfileId from the meterDefine table). If a value is provided, the value will be checked against the unitProfileName column in the unitProfileDefine table. If the unitProfileName is not found, the meter data will be rejected.

@dqInfoName

N

T_nameType, nvarchar(32)

The value will be checked against the column dqInfoName in the dqInfoDesc table. Options are as follows:

  • Null/None — No data quality information to report.

  • Clock Drift — Clock drift check failed.

  • Clock Sync — Clock sync check failed.

  • Invalid — Data source deems data invalid.

    If the dqInfoName is not found, the meter data will be rejected.

@volume

N

T_doublePrecisionType, float

The volume of the fluid corrected to standard conditions. The units are defined by the configured Input Unit Profile of the meter if a unit profile is not included as part of the meter reading.

@energy

N

T_doublePrecisionType, float

The amount of energy released if the volume was part of an ideal combustion reaction. The units are defined by the configured Input Unit Profile of the meter if a unit profile is not included as part of the meter reading.

@flowTime

N

T_flowTimeType, real

The amount of time that the commodity (usually gas) was flowing. For an hourly record, the max would be between 0 and 1 hour inclusively. The units are defined by the configured Input Unit Profile of the meter if a unit profile is not included as part of the meter reading. The flowTime will be less than or equal to the runTime.

@pressure

N

T_doublePrecisionType, float

The recorded static or gauge pressure, depending on the Unit Profile. The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading.

@temperature

N

T_doublePrecisionType, float

The recorded temperature. The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading.

@rawValue

N

T_doublePrecisionType, float

The data provided for this value will depend on the type of meter the data is for:

  • Orifice meter — Differential pressure

  • Pulse meter — Pulse count

  • Corrector meter — Pulse count

  • Manual meter — Pulse count

  • Linepack meter — Inlet pressure

  • Coriolis meter — Pulse count

    The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading.

@intermediateValue

N

T_doublePrecisionType, float

The data provided for this value will depend on the type of meter the data is for:

  • Orifice meter — Flow extension

  • Pulse meter — Uncorrected volume

  • Corrector meter — Uncorrected volume

  • Manual meter — Uncorrected volume

  • Linepack meter — Inlet temperature

  • Coriolis meter — Uncompensated mass

The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading.

@primaryFactor

N

T_doublePrecisionType, float

The data provided for this value will depend on the type of meter the data is for:

  • Orifice meter — C' factor from the factored form of American Gas Association (AGA)-3.

  • Pulse meter — Fp*Ft*Fpv2 for AGA-7, this is the pressure, temperature, compressibility factor combined into one factor.

  • Corrector meter — Fp*Ft*Fpv2 for AGA-7, this is the pressure, temperature, compressibility factor combined into one factor.

  • Linepack meter — This is the outlet pressure.

The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading.

@waterVaporFactor

N

T_doublePrecisionType, float

A correction factor to account for gas that is carrying water over a contractually defined limit [usually 7 lbs/MMCF, for wet gas]. How the factor is applied is dependent upon the delivery condition defined in the unit profile and whether the factor has been configured to be applied to the volume or heating value. If this is not specified, it will be calculated according to the Meter Properties.

@volumeAccum

N

T_doublePrecisionType, float

The data provided for this value will depend on the type of meter the data is for:

  • Linepack meter — volume, called Instantaneous Volume. This is used to calculate the linepack volume (@volume) which is the difference between this value and the Instantaneous Volume of the previous reading.

  • All other meter types — total volume accumulated. This value keeps increasing until the rollover value of the device has been reached.

The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading.

@energyAccum

N

T_doublePrecisionType, float

The data provided for this value will depend on the type of meter the data is for:

  • Linepack meter — energy, called Instantaneous Energy. This is used to calculate the linepack energy (@energy) which is the difference between this value and the Instantaneous Energy of the previous reading.

  • All other meter types — total energy accumulated. This value keeps increasing until the rollover value of the device has been reached.

The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading.

@miscValue

N

T_doublePrecisionType, float

Miscellaneous value. The data provided for this value will depend on the type of meter the data is for.

  • Linepack meter — Outlet temperature

  • All other meter types — This can be used for numerical values that get reported by the device that aren't usually part of a meter reading.

The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading.

@validate

N

T_booleanType, char(1)

Default is NULL (gets turned into a Y if NULL). Options are as follows:

  • NULL — System will perform validation on the record.

  • V — System will perform post calculation validation only.

  • Y — System will perform validation on the record.

  • N — System will skip validation on the record.

@isSummer

N

T_booleanType, char(1)

This is used when the system is interpreting the startTime and endTime datetimes when Daylight Saving Time ends and the datetimes during that transition are unclear. For example, during the fall DST change in North America, the 1-2AM time is repeated, this is used to specify which 1AM record it is. Options are as follows:

  • NULL — Indicates an N

  • N — If there's a question about the time, the system will assume the winter timezone (not in DST).

  • Y — If there's a question about the time, the system will assume the summer timezone (in DST).

@runTime

N

T_doublePrecisionType, float

The total time between the start of the reading and the end of the reading. This value will be calculated from the @startTime and @endTime parameters when the data is processed. Accordingly, this input variable is ignored.

@time

N

T_GMTtime, int

The start time in seconds from Jan 1, 1970 in GMT. When specified, this will be used instead of the @startTime value.

@offset

N

T_GMToffset, smallint

The timezone represented in minutes from GMT. This value will be calculated. For example, the Mountain Standard timezone is -420 and the Mountain Daylight timezone is -360.

@endGMTTime

N

T_GMTtime, int

The end time in seconds from Jan 1, 1970 in GMT. When specified, this will be used instead of the @endTime value.

@endOffset

N

T_GMToffset, smallint

The timezone represented in minutes from GMT. This value will be calculated. For example, the Mountain Standard timezone is -420 and the Mountain Daylight timezone is -360.

@timeFormat

N

T_nameType, nvarchar(32)

This was used as a string to let the system know how to interpret the localTime string. The default is '%m/%d/%Y %T'.

Note: This has been deprecated.

@mass

N

T_doublePrecisionType, float

The mass of the fluid. The units are defined by the configured input unit profile of the meter if a unit profile isn't included as part of the meter reading. If mass is not provided, it will be calculated from the volume and the specific gravity or density of the associated gas quality for gas or liquid respectively.

@Zratio

N

T_doublePrecisionType, float

A dimensionless number that represents the compressibility factor of the gas at base conditions (Internal Storage) divided by the compressibility of the gas at flowing conditions (the base conditions of the unit profile specified in CD_ZRATIO_UNIT_PROFILE).

This is calculated by the system.

@hydrocarbonDewpoint

N

T_doublePrecisionType, float

For the static pressure of the meter reading, this is the temperature where hydrocarbon liquids begin to form. The units are defined by the configured Input Unit Profile of the meter if a unit profile isn't included as part of the meter reading. If this is not specified, it will be calculated according to the Telemetry Calculation Policy.

@uncorrVolAccum

N

T_doublePrecisionType, float

The total flowing volume (not corrected to standard conditions) accumulated. This value keeps increasing until the rollover value of the device has been reached. The units are defined by the configured Input Unit Profile of the meter if a unit profile is not included as part of the meter reading.

@rawValueAccum

N

T_doublePrecisionType, float

For a pulse meter, this is the total accumulated pulse counts over time. The value would reset at the meter rollover value.

@adjustmentCodeName

N

T_nameType, nvarchar(32)

If an adjustment is made to a previously submitted reading, the source system may choose to include a reason for the adjustment. This value maps to the column adjustmentCodeName in the table adjustmentCodes. If the code doesn't exist in the system, the reading will be sent to the Rejected Readings table with a reason of Invalid Adjustment Code Name.

TitleResults for “How to create a CRG?”Also Available in