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

AVEVA Enterprise SCADA High Performance Database (HPDB) API Reference

Use the FieldGet and FieldPut methods

This scenario guides you through the steps required to use the FieldGet and FieldPut methods for an analog record in the RealTime database (RTDB).

To identify the code associated with each step, see the code comments in the Example code section.

Using the virtual path will enable you to go through the Virtual Database (VDB) layer in real time using managed code.

To use the FieldGet and FieldPut methods

In this example, the remote field is used; the type is slot.

If you want to get the value from the database converted to a string, use the FieldGetConvertedToString().

  1. Open the Program.cs file from the created project.
  2. Open the RTDB.
  3. Access the analog table through a path.
  4. Use the FieldGet proper function to get the field value.
  5. Use the FieldPut proper function to put a field value.

Example code

IRealTimeDatabase database = new RealTimeDatabase();
try
{
    // Open the RTDB.
    if (!database.IsOpen())
    {
        database.Open();
    }
    // Access the analog table through a path.
    var virtualPath = database.GetVPath("analog", "AutoCommandAnalog01", "rtu");
    // Use the FieldGet proper function to get the field value.                    
    Console.WriteLine(
quot;
{virtualPath.FieldName} number: {virtualPath.FieldGetSlot()}"); virtualPath.FieldPutSlot(10); // Use the FieldPut proper function to put a field value. Console.WriteLine(
quot;
{virtualPath.FieldName} updated to: {virtualPath.FieldGetSlot()}"); } catch (Exception ex) { Console.WriteLine(
quot;An error occurred while reading/writing the slot field:
{ex.Message}"); }
TitleResults for “How to create a CRG?”Also Available in