• Not Answered

How can we save/retrieve DeltaV floating point array to/from TXT file?

We use several floating point arrays to storage huge amount of process parameters (~10,000). However, we find out the Array data can't be recovered after power off the controller and cold restart.  So, how can we export/import array to/from any type of  file which can be safely store at Operate Station or Engineering Laptop ?

Our DeltaV system is PK controller Version 14.5 and use DeltaV Operate at DeltaV Panel PC.  We are not using DeltaV Batch.

17 Replies

  • Have you considered using the DeltaV Excel add-in? I'm no expert but I believe it would allow you to import/export your array data to/from Excel. Not sure how it works in the PK environment, though, as we've only used it in a full DeltaV system.
  • If it's just about storing them, you could also use the LOGEVENT function in an action block to loop through the arrays and write them to the Event Journal. The advantage would be that they are written into the Alarms&Events database, so it's not a separate file you have to manage.
  • I ran across this issue as well. As I recall, using the Excel add in didn't work because I could not figure out what syntax to use. Same as trying to read the data using OPC watchit. If you can read it OPC, then that give other options for reading the data.
  • In reply to MPHymel:

    Format for Floating Point Arrays is just has the addition of [x][y] where x is row and y is the column. Example: MODULE/FP_ARRAY[3][2]
  • In reply to Martin Rooke:

    Unfortunately, stand alone PK controller didn't support EXCEL add-in. Also, I believe the EXCEL import/export function is using OPC-DA and it will not support Array data format(Maybe I am wrong). It looks like only OPC-UA can support Array data type.
  • In reply to Weiming Sun:

    Matt, pretty sure I tried that, but it was months ago. I suspect I will be attempting that again for a different purpose soon.
    Martin, good to know, I have a UA license, will file that away for the future.
  • DeltaV Operate (VBA) can read/write to DeltaV array parameters, and to text files. This may be a solution for you to save and reload the array data, however 10,000 parameters may cause the graphics to lock up and not respond for a significant period. If the number of parameters were split up to manageable logical groups (probably less than 1,000) on separate buttons on a graphic then it could work, if time was allowed for the datalinks to expire from the graphic read buffer. From your post I am assuming that this will be a user initiated save/reload and not an automated action.
  • Hello,

    I think there are a few ways you can solve this issue.

    The first method I would consider is using VBA in DeltaV Operate to facilitate this. You can write VBA to loop through the parameters you want and to dump them to a formatted text file. This can be executed on demand so that any load or pause on the HMI is expected. You can also use the scheduler to do this on a scheduled basis on a specific HMI.

    The second method I would consider is to use Sytech XLReporter. It has the ability to connect via OPC DA or OPC UA to DeltaV. You can configure it to read these values on demand and then store them in either a speadsheet or have them inserted into a SQL database of some kind.

    I would lean towards this second solution as it is low-load on the system and can be scheduled.
  • In reply to dave_marshall:

    Accessing 10,000 parameters via OPC can cause OCP licensing issues if not handled correctly.

    An OPC call to a parameter uses 1 OPC license. Depending on how the call is structured, and also on how the 3rd party OPC client is setup, those licenses can remain 'active' for extended periods. If you are not careful, the OPC license count will be exceeded, and other OPC users (such as data historians) may be impacted.

    Make sure the OPC tags/groups are opened/closed properly to release the license
  • In reply to Chris:

    Sounds a good idea. I will try it to separate the huge number of parameters to several group. Do you have some sample VBA script code in DeltaV Operate? Thanks in advance!
  • In reply to dave_marshall:

    Thanks Dave. Can Sytech XLReporter handle read/write parameter via OPC DA or UA? By user command, can XLReporter write those parameters from DV to external file, TEXT, Spreadsheet, or SQL database..., and read these parameters back into DeltaV ?
  • Hi
    Use Deltav excel add on
     Data can be read or written via native OPC


    Sent from my iPhone

    On 12 Sep 2022, at 19:51, Weiming Sun <bounce-Weiming_Sun@emersonexchange365.com> wrote:

    
    EE365_5F00_RGB_5F00_Standard_5F00_69x42-png_2D00_90x55-png Update from Emerson Exchange 365
    avatar-png_2D00_70x70x2-png
    Weiming Sun

    Sounds a good idea. I will try it to separate the huge number of parameters to several group. Do you have some sample VBA script code in DeltaV Operate? Thanks in advance!

    View online

     

    You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

    Flag this post as spam/abuse.

  • In reply to Weiming Sun:

    XLReporter can read and report data from any OPC DA or OPC UA Server.

    XLReporter can read this data and by default stores it into an Excel workbook. There are options to export this data to many different formats including (but not limited to) Text Files, any relational database, XML files, encrypted PDF files and HTML web pages.

    In addition, XLReporter can export data back into DeltaV parameters through the OPC DA and the OPC UA servers.
  • In reply to Weiming Sun:

    Here is a subroutine I put together this morning, should be a place to start from:


    Sub Test_Read_Array()

    Dim sFileName As String
    Dim oFso As Object 'file system object
    Dim oOutFile As Object 'File

    Dim i As Integer 'for loop
    Dim j As Integer 'for loop

    Dim sModuleParam As String
    Dim iCmdStatus As Long
    Dim sCmdStatus As String
    Dim fValue As Single

    Const ForReading = 1, ForWriting = 2, ForAppending = 8

    sFileName = "D:\Values.txt"

    Set oFso = CreateObject("Scripting.FileSystemObject")
    Set oOutFile = oFso.OpenTextFile(sFileName, ForWriting, True)

    'loop though the array and read each value
    For i = 1 To 10
    For j = 1 To 1
    'Create the parameter path to read from
    sModuleParam = "DVSYS.YOUR_MODULE/PV_ARRAY[" & i & "][" & j & "].F_CV" ' build the parameter string to read
    'read value
    fValue = frsreadvalue(sModuleParam, iCmdStatus, sCmdStatus, False)
    'clear error string if there is no error
    If iCmdStatus = 0 Then sCmdStatus = vbNullString
    'write to test file
    oOutFile.writeline sModuleParam & vbTab & fValue & vbTab & sCmdStatus
    'release Operate VBE thread for other tasks
    DoEvents
    Next
    Next i
    'close off file
    oOutFile.close

    End Sub
    Sub Test_Write_To_Array()

    Dim sFileName As String
    Dim oFso As Object 'file system object
    Dim oInFile As Object 'File

    Dim i As Integer 'for loop
    Dim j As Integer 'for loop

    Dim sLine As String
    Dim aLine As Variant

    Dim sModuleParam As String
    Dim iCmdStatus As Long
    Dim sCmdStatus As String
    Dim fValue As Single
    Dim iLbound As Integer
    Const ForReading = 1, ForWriting = 2, ForAppending = 8

    sFileName = "D:\Values.txt"

    Set oFso = CreateObject("Scripting.FileSystemObject")
    Set oInFile = oFso.OpenTextFile(sFileName, ForReading, True)

    'loop though the array and write each value to module
    Do
    'check that we are not at the end of the file
    If oInFile.AtEndOfStream Then
    Exit Do
    End If

    sLine = oInFile.ReadLine 'read a line from text file
    'check that we are not at the end of the file

    aLine = Split(sLine, vbTab, , vbTextCompare)
    iLbound = LBound(aLine, 1)
    'check there are 3 or more fields
    If (UBound(aLine, 1) - iLbound + 1) >= 3 Then
    'check if there was a read error
    If Len(aLine(iLbound + 2)) = 0 Then
    sModuleParam = aLine(iLbound)
    fValue = Trim(aLine(iLbound + 1))

    sModuleParam = Trim(sModuleParam) 'trim off white space

    frsWriteValue fValue, sModuleParam
    'Debug.Print sModuleParam, fValue
    DoEvents
    End If
    End If
    Loop
    oInFile.close

    End Sub
  • In reply to Chris:

    Be aware of loading issues. Per the system capacities topic in Books On Line, there is a "write operations per node" that should be observed. This will be hitting the controller in the same manner that any operator interface initiated change does. Its a fairly high priority communication intended for human input to the controller. As such there is at least the potential to affect control performance if the recommended limits are exceeded. As always, it depends on the load on the controller at the time and you might get lucky and not affect anything. Or if you don't feel lucky, then build in some appropriate mechanism in the code to throttle the writes.

    Even if this is done with OPC, this loading factor shall still be considered. The reason for recommending landing modules in the application station where the OPC server is resident is so that the controller can "read" the values from the landing modules, rather than using a higher priority "write" methodology.