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

AVEVA Enterprise SCADA

Create a Decode Template

  • Last UpdatedApr 24, 2025
  • 4 minute read

Follow this procedure to create a definition, or "Decode Template", for a specific stored procedure.

To create a decode template

  1. On the Data Payload Processor (DPP) Config Tool window, select New > New Decode Template.

    The New Decode Template dialog box opens.

  2. (Optional) DPP automatically generates the Template ID. If you want to group several Decode Templates together, assign them closely related IDs.

    One example would be assigning the IDs 500-504 to five Decode Templates associated with a particular protocol.

  3. Enter a Template Name that helps to identify the Decode Template's purpose.

  4. Enter a Template Description.

  5. In the Stored Procedure field, do one of the following:

    • Select the procedure that DPP calls when the Decode Template's associated Decode Define matches an inbound raw record.

    • Enter the name of a desired stored procedure not provided in the field's list.

  6. Select Save.

    The following occurs:

    • DPP generates a list of all the usable parameters in Decode Method format for the procedure selected in Step 5.

    • The Decode Method Template dialog box opens with these generated parameters.

      Embedded Image (65% Scaling) (LIVE)

      The following fields on the Decode Method Template dialog box are read-only:

    • Parameter – a description of the parameter of the stored procedure.

    • Data Type – the pre-defined data type of the parameter.

      Follow the steps below for each parameter you want to use in the stored procedure call.

  7. In the Action field, determine if the pre-defined internal stored procedure to convert the input data type to the required data type of the stored procedure parameter is satisfactory. Edit the field as desired.

    The list of supported actions is as follows:

    • When Input Data Type is String:

      • string2string – string-to-string copy with no conversion.

    • When Input Data Type is Byte String:

      • HexASCIISmallEndian2Float – convert small endian hex stream into an IEEE-754 float.

      • HexASCIISmallEndian2Integer – convert small endian hex stream into an integer.

      • HexAsciiToFloat – convert big endian hex stream into an IEEE-754 float.

      • HexAsciiToDouble – convert big endian hex stream into a double.

      • HexAsciiToInteger – convert big endian hex stream into an integer.

      • Hex2String – convert a hex stream into an ASCII string.

      • HexAsciiReverseToFloat – convert mid little endian hex stream into an IEEE-754 float.

      • HexASCIISmallEndian2Integer16 – convert small endian hex stream into a 16-bit integer.

      • HexAsciiToInteger16 – convert big endian hex stream into a 16-bit integer.

  8. In the Input Data Type field, select the payload data type:

    • Byte String – select if the payload consists of a string of raw bytes.

    • String – select if the payload consists of a delimited string.

      Note: If you select Byte String, the system forces the String Delimiter field to None when you save the record, as the latter field is no longer applicable.

  9. In the Type field, select how DPP should process the value:

    • CustomSP – select to enter a custom stored procedure that returns a value for the parameter.

    • CustomSP2 – select to enter a custom stored procedure that returns a value for the parameter.

    • CustomSP3 – same as above, but allows you to use a byte string instead of a text string when passing in the payload.

    • Enumeration – select to use values defined in the Enumeration Define table.

      Note: DPP automatically creates an Enumeration Method for parameters of type Enumeration. For further information, refer to Add an Enumeration to an Enumeration Method.

    • Fixed Value – select to apply the hard-coded value in the Source column to the destination parameter for the stored procedure.

    • Standard – select to retrieve data based on the configuration of the Delimiter/Byte Offset and Source fields.

    • Standard Date Time – select to convert an incoming byte string into the standard date/ time format.

  10. In the String Delimiter field, select what DPP should use to delimit the incoming data:

    • Backslash

    • Comma

    • None

    • Slash

    • Vertical Bar

    Note: As mentioned above, if you select Byte String as the Input Data Type, the system forces the String Delimiter field to None when you save the record.

  11. If the Input Data Type is Byte String, in the Byte Count field select the number of bytes following the selected offset to translate.

  12. In the Delimiter/Byte Offset field, enter the starting position of the value within the payload.

  13. In the Source field, indicate the source of the value:

    • If the source is the Payload column of the rdm_readingRaw table, enter Payload.

    • If the source is an xml tag in the rdm_readingRaw table, enter the location of the value.

      For example, if the xmlCommandRequest column in the rdm_readingRaw table contains "<commandRequest><primary>Name</primary></commandRequest>", typing commandRequest.primary retrieves the value "Name".

    • If the Type is Fixed Value, enter the hard-coded text to apply to the parameter.

  14. Select Use Parameter.

    After you save changes, DPP creates a Decode Method for each row where Use Parameter = True. The new Decode Methods appear in the Method Define tab of the DPP Config Tool window.

    Note: If you do not select Use Parameter, DPP calls the stored procedure with the default value for the specific parameter when it processes the data. If the default value is not supplied or allowed, the call fails.

  15. Select Save.

  16. Back on the DPP Config Tool window, select Refresh.

    The new Decode Template should now appear in the Template Define tab of the DPP Config Tool window.