QuickPanel Plus History Alarms to CSV

Hello

I'm very newbie to Emerson products, I need a way (script?) to write on USB memory a CSV of all historical alarms:

I've not found any resource, on manuals, on web (also here) that explain how to do this (I think) relative simple task.

10 Replies

  • DeltaV Alarms and Events are stored in the Event Chronicle A&E Database. This is a SQLExpress database that is accessed with Process History View. Process History view provides export functions to allow saving a filtered list to file. However, it does not have a mechanism to do this programmatically. It does provide the means to back up the database itself as a whole.

    The Alarms and Events can also be accessed with the OPC A&E server, which is an additional license. This allows OPC clients to subscribe to the Alarm and Events for use externally to the DeltaV system.

    Emerson Also has DeltaV Mobile which exposes Alarms and events via a Phone based Android or iPhone app for pushing targeted alarms to users.

    The SQLExpress database can also be accessed directly via ODBC connection to query the database via scripting, but that is not a supported product feature. That is, it is not documented for that purpose, and that is why you don't find that approach discussed in the standard literature. There are existing posts in this forum that discuss accessing the database directly and how to build a SQL query to retrieve filtered data. (i.e. only alarms).

    If you are looking to analyze the alarm system performance, Emerson has the AgileOps Performance Analytics software that provides this along with canned reports.

    maybe is you shared why you need this, a more specific solution might reveal itself.

    Andre Dicaire

  • If you have QuickPanel+ operator interface, this is easily achievable using a script. The QuickPanel+ supports both proprietary ViewScript as well as open VBScript. ViewScript is better documented in PAC Machine Edition but VBScript should give more flexibility and run faster.

    Here is a sample VBScript:

    '-------------------------------------
    ' Script Created: Feb 20, 2018
    ' Description: Log Data To CSV File
    ' Application script period = 60000 ms = 1 minute
    ' VBScript
    '-------------------------------------
    'Get current year, make as start of file name
    LOGFILENAME.Value = Cstr(CurrentTime.Element("YR").Value)
    'Get current month, add to file name
    LOGCURRENTMONTH.Value = CurrentTime.Element("MO").Value
    If LOGCURRENTMONTH.Value < 10 Then
    LOGFILENAME.Value = LOGFILENAME.Value + "0"
    End If
    LOGFILENAME.Value = LOGFILENAME.Value + Cstr(LOGCURRENTMONTH.Value)
    'Get current day, add to file name
    LOGCURRENTDAY.Value = CurrentTime.Element("DAY").Value
    If LOGCURRENTDAY.Value < 10 Then
    LOGFILENAME.Value = LOGFILENAME.Value + "0"
    End If
    LOGFILENAME.Value = LOGFILENAME.Value + Cstr(LOGCURRENTDAY.Value)
    'Get current hour, add to file name
    LOGCURRENTHOUR.Value = CurrentTime.Element("HR").Value
    If LOGCURRENTHOUR.Value < 10 Then
    LOGFILENAME.Value = LOGFILENAME.Value + "0"
    End If
    LOGFILENAME.Value = LOGFILENAME.Value + Cstr(LOGCURRENTHOUR.Value)
    'Add path and .csv to get full file name - note SRAM storage
    LOGFILENAME.Value = "\SRAM Storage\" + LOGFILENAME.Value + ".CSV"
    'Open log file or create new log file if there isn't one
    LOGFILEHANDLE.Value = View.LogOpenFile (LOGFILENAME.Value)
    If LOGFILEHANDLE.Value = -1 Then
    LOGFILEHANDLE.Value = View.LogNewFile (LOGFILENAME.Value)
    'Add Column titles to new file
    View.LogPrintString LOGFILEHANDLE.Value, "DATE, TIME, VAL1, VAL2, VAL3"
    View.LogNewLine LOGFILEHANDLE.Value
    End If
    View.LogSetUseComma LOGFILEHANDLE.Value, 1 ' Add comma after LogPrintValue (default)
    'Log the current data
    View.LogDate LOGFILEHANDLE.Value
    View.LogTime LOGFILEHANDLE.Value
    View.LogPrintValue LOGFILEHANDLE.Value, SIMTANK1.Value, 3
    View.LogPrintValue LOGFILEHANDLE.Value, SIMTANK2.Value, 3
    View.LogPrintValue LOGFILEHANDLE.Value, SIMTANK3.Value, 3
    View.LogNewLine LOGFILEHANDLE.Value
    'Close file so it doesn't get corrupted
    View.LogCloseFile LOGFILEHANDLE.Value
    'Check hour rollover, move all csv files to SD card
    'This copes with SD card beinhg removed, since files remain in local
    'memory until SD card is available, then all copies moved
    'So also no issues with deleting files locally either
    If LOGPREVIOUSHOUR.Value <> LOGCURRENTHOUR.Value Then
    ' Delete old files here
    ' View.FileDelete "\SDMemory\*.CSV"
    View.FileMove "\SRAM Storage\*.CSV", "\SDMemory\", 0 ' Overwrite
    ' Use httcopy here to move to external location
    End If
    LOGPREVIOUSHOUR.Value = LOGCURRENTHOUR.Value
  • In reply to Andre Dicaire:

    Hello Andre, thank you for quck answer: my target is Emerson RX3i CPE305 so all related to powerful DeltaV DCS are not applicable here.
  • In reply to Steve Ward:

    Very very very thanks Steve: I'll check, adapt and test the code from next week, when I put the hand again: my first problem is reach (both in ViewScript and VBScript) the correct data in QP+ the keyword and other specific things related to this customized version of scripting.
    Without abuse your patience could you link the manuals that explain scripting in QP+? I've download some ot that but none have deep explanations of scripting languages.

    Thank you again Steve
  • In reply to Gabriele Corrieri:

    PAC Machine Edition help has a section on QuickPanel+ scripting and a ViewScript script reference. For VBscript, PAC Machine Editionhas an overview and additional resources are available online. See also the QuickPanel+ documents on our Emerson Customer Centre at emerson-mas.my.site.com/communities - search for QuickPanel+ or start at the QuickPanel+ landing page: emerson-mas.my.site.com/.../QuickPanel-Plus-Landing-Page.
  • Gabriele, there is also a script function named "ViewLogToHistorianCSV". This will generate a CSV file with data from the panels historical logging function. It probably generates a number of columns you don't care about but is an easy way to get there.
  • In reply to Steve Ward:

    Very thanks again Steve!!
  • In reply to Mats Andersson:

    Hello Mats: what you mean when youi type "there is also a script function named" I've not founf any for that keyword.
    to be truly honest I've found I've found that two pages
    www.ge.com/.../t_hgs_managing_log_files.html
    www.ge.com/.../c_hgs_about_historian_log_files.html
    that explain something about an external tool for logging: my target is a hmi pushbutton that catch all the history alarm box and write as-is to an CSV file keeping all event date and time: in case of trouble technician on-site will put an usb memory key into panel, push the button and wait for csv writing, than extract the key and on a desktop or laptop computer send that file to me for troubleshooting

    Thanks again
  • In reply to Gabriele Corrieri:

    Yes, we could probably do a better job with the user docs. The ViewLogToHistorianCSV is described in the PAC Machine Edition help file. The function is intended to be used with the Proficy Historian product from GE, but it's just a CSV text file. Ignore all the GE Proficy Historian references. As I mentioned this function will have a number of columns you don't need/want so it may not work for your application.
  • In reply to Mats Andersson:

    Hello Mats I'm again hands on (I've some trouble in the past week with higher priority to solve)

    I've open just few hours ago the online help, but since I've newbie both in general HMI scripting and Emerson products, what I've found is that:

    the 3rd row is the core of function explain and is very short

    I'm very confused because my target is making a new page with a button, and maybe the destination directory and filename with the contents of the historical alarm table

    Because the CSV on output will be read by human technician unuseful or redundant columns are not a problem.

    I hope that explanation is more detailed from the past.

    Thanks in advance for any help