SCADA Calculation Engine Database Configuration
The SCADA_CALC_FUNC table holds the calculation engine configuration mapping. Insert into this table the specific rti_alias point names and functions to call for each mapping needed. Alternately, if your rti_alias point names follow the standard <device_alias>-<attribute name> convention, you can use [ALL], which creates this mapping for every device that has these measurements.
 
Column
Description
seq_id
The generated primary key from the scada_calc_seq sequence.
rti_alias
The point name to update.
unc_name
The function to call. NMS provides many examples in the scadacalc package.
func_args
The arguments to the function. Put single quotes around strings, like point names.
Examples
1. This multiplies the BR2411-kv_A by 1000 and puts it in the BR2411-v_A point, using the provided multiply_value() function:
INSERT INTO scada_calc_func (seq_id, rti_alias, func_name, func_args)
VALUES( scada_calc_seq.nextval, 'BR2411-v_A', 'scadacalc.multiply_value','''BR2411-kv_A'', 1000' );
2. This averages the by-phase BR2411-Amps_A, BR2411-Amps_B, and BR2411-Amps_C measurements and puts the result in the BR2411-Amps point, using the provided avg_3() function:
INSERT INTO scada_calc_func (seq_id, rti_alias, func_name, func_args)
VALUES( scada_calc_seq.nextval, 'BR2411-Amps', 'scadacalc.avg_3', '''BR2411-Amps_A'',''BR2411-Amps_B'',''BR2411-Amps_C''' );
3. This sums all Amps_A + Amps_B + Amps_C to the Amps_Sum measurement for every device that contains those measurements. All measurement rti_aliases must have the same prefix (usually the alias), and the suffixes must match the attribute names. This uses the provided sum_3() function:
INSERT INTO scada_calc_func (seq_id, rti_alias, func_name, func_args)
VALUES( scada_calc_seq.nextval, '[ALL]-Amps_Sum', 'scadacalc.sum_3', '''[ALL]-Amps_A'',''[ALL]-Amps_B'',''[ALL]-Amps_C''' );
A large set of functions are already available in the scadacalc package, but others can be defined by the project team, if needed.
Notes on adding new procedures:
Follow the convention that the first parameter is the resulting rti_alias name.
Be sure method names are unique. Add the number of arguments, analog or digital, etc. to make the names unique.
Use the existing scadacalc procedures as a guide and reuse the get_analog(), get_digital(), insert_analog(), insert_digital() functions.