• Not Answered

DeltaV Live web content from local workstation

Can anyone share an example of how to display an html file from the local workstation in the DeltaV Live web browser object?

BOL states this can be done but does not give a location to store the html file or criteria for a local web server. It works fine for external web content but that is not feasible in a secure system. Using "file://..." or Node.js to add "localhost:8080" is not working on my system even with adding it to $UrlWhiteList. The ultimate objective is to have an equivalent of a VBA ListBox in Live.

Thanks.

15 Replies

  • Only web server references are allowed for CyberSecurity purposes (i.e. http, https)

    Don't believe there is a way for ListBox to be supported within the product itself, Can you use ComboxBox or Radio Button entries?
    Maybe posting a pic of Operate version (I assume you have this already) so the forum can give suggestions on methods for migration.
  • In reply to Matt Stoner:

    Matt,

    Below is an example of the type of Operate VBA ListBox I would like to replicate in Live. In Operate VBA the data is an array that can be displayed in the Listbox so the user can scroll and take actions like click on an entry. This is not specific to alarm data but used for other types of data. The same thing could be done in a web page using HTML5 code but my question is how to display web document this inside a Live web browser. The web browser is also handy for document display inside the graphics like P&ID and SOP.

    BOL mentions the broser can display "URLs on the local machine" and suggests video feed and "local applications" as examples but does not explain how this is done. I can't figure out where to place my html file so the web browser can display it. Does it require setting up a local web server with something like Apache or Node.js and if so are there restrictions on port numbers, etc.? Is there a special 'home' directory to use? Do you need to set up a web server on the local network? I'd like to be sure any local web server does not interfere with Live.

    Any examples of dislaying web content from the local machine or suggestions for replicating a ListBox would be a great help.

    Thanks,

  • In reply to RobPerry:

    I will forward this example to Product Marketing for consideration of possible future enhancement.

    Yes you would need to setup a local webserver using IIS (at least that is what we have done to support some help files that moved to HTML format) that you can reference in www.alarmdata.com format.

    Another way could be if you can get the data into SQL then you could display it that way with DeltaV Live SQL connections.
  • In reply to Matt Stoner:

    Matt,

    I looked into the SQL data sources in DeltaV Live. What this allows you to do is write a SQL select statement that can return multiple rows of a number of items, similar to the example above. The result is stored into an array of string arrays which allows you read the data via the typescript script. Now you need to move this to a display object. The examples given in BOL effectively have you move the array data to variables or datalinks the script can reference.

    I think that's the challenge. It would be nice to have a list box that you could programmatically set the size of and then populate with the Select Station result.

    Or better still (maybe) is a list box that has properties where you can define the SQL datasource and the select statement such that the result populates the List box directly. Since the Select statement defines the number of items to read, that sets the number of columns. From what I can tell, the current implementation requires you to set a maximum number of returned items. That would set the List box number of rows. When you display this, you would get scroll bars automatically if the size of the object on the display was smaller than the number of rows or columns.

    I'd like both options, one where I define the size of the list box and populate it from a Typescript script that gets data from DeltaV or Live variables and such, and the second where it can be defined to get data from a SQL query, where the SQL query can be modified at runtime via a script. That would allow you to view the alarms and events from a module in a contextual display based on the module name.

    And while we are at it, let me define and redefine the size of the list box rows and columns at runtime.

    OK that's enough.

    As for what we have today, would it be feasible to couple a SQL database with an IIS server that would allow the Web Browser to provide interactive controls via web page that would provide access to a SQL table. The SQL Data Source would allow data from the sQL tables to drive DeltaV Live displays, like color expressions and other animations, or event some KPI objects directly in displays. A web page would provide List boxes and other such display options with interactive controls if data entry is needed.

    Set these up on an Application station that might allow access from L3 sources as well. Hmm.

    Andre Dicaire

  • In reply to Andre Dicaire:

    Matt / Andre,
    Thanks for the suggestions. Activating IIS has let me bring up an html document from the local machine into the Live embedded web browser so that's a big step forward. I can now explore what code can run in that browser and any data exchange mechanisms with Live. Recordsets retrieved by SQL can be stored in variables or even csv files.
    It sure would be nice to have a listbox control available in Live like Andre described. If I get something working I'll post it here.
    Thanks again.
  • In reply to RobPerry:

    Glad you are moving forward. As for using a csv file, I don't think Live can store the values to a file nor read them. If the data is in SQL, Live can read it an bring it to a variable, data link or wherever via the script that runs the SQL query.

    Andre Dicaire

  • In reply to RobPerry:

    I thought I followed BOL to the latter but I couldn't get the web browser control to display default IIS webpage. Any hints Rob?

    Note I am seeing the following in the DevConsole:
    VM32 about:blank:1 Network request blocked by whitelist: http://localhost/

    I have re-read, copy/pasted my whitelist and also created $UrlWhitelist but still nothing. By the way, I am using 14.3.FP1 on a domain.
  • In reply to Lun.Raznik:

    This is what I have done to get something going. I am using a stand-alone Simulate v14.3.1 Build 11067.

    • Install and activate Windows IIS (it would not install for me until I manually created a dummy file at C:\inetpub\custerr\en-US\401-1.htm).
    • Create a basic html doc called: c:\inetpub\wwwroot\HelloWorld.html and check it opens in a browser as 127.0.0.1/HelloWorld.html

    <!DOCTYPE html>
    <html>
    <head>
    <title>Hello World</title>
    <body>
    <p>Hello World!</p>
    </head>
    </html>

    • In Live created whitelist string variable under Standards with the value http://127.0.0.1
    • In a display added a web browser with source "http://127.0.0.1/HelloWorld.html" and whitelist connected to the standard created.

    That seems to work so I am going to explore out from there and see what kind of html functions and scripting the embedded browser supports, also how to get data from Live into the browser.

    Hope this helps.

          

  • In reply to RobPerry:

    Thanks for the detailed explanation Rob! I can see my page now.
  • In reply to Lun.Raznik:

    To wrap this up I promised to post if a method could be found to send data (value, text, array) from DeltaV Live to the web browser. It can be done using HTML5 cross-domain messaging after converting to JSON format.

    In the browser an html file script uses addEventListener to set up an event to receive data from the DeltaV Live domain (http://localhost:5000). In Live the trick is to find the id of the web browser (an HTML5 iframe object) to send the data. The key parts of the code are listed below. The browser can then be used for tables, display, processing, data exchange with sessionStorage, etc. The process also works in reverse so appropriate security must be included in any code.

    Web Browser script (start)

    DeltaV Live script (partial)

  • In reply to RobPerry:

    Rob, Much appreciated. DeltaV Live changes how we can interact with non DeltaV information. The goal appears to be to create a more secure environment, but with that come challenges to access outside resources. We will all have to learn some new tricks.

    Andre Dicaire

  • In reply to RobPerry:

    Many thanks Rob, you've managed to accomplish what hundreds of StackOverflow threads couldn't. You mentioned that the process works in reverse, though I'm struggling on how to make this true. Do you have any code snippets where the web browser script writes to DeltaV Live and Live has an active listener function?

  • In reply to Andrew Daly:

    Glad you found the code useful despite me mixing up the labels of the code.

    The test I did to go from browser to DeltaV Live is shown in the graphic below that I hope is readable. A button script in DeltaV Live starts a listener, a button in the webpage writes data to the listener, and the listening script receives and places the data into a DeltaV Live object. It's a bit of a manual process but hope it helps your project.

  • In reply to RobPerry:

    Much appreciated, I'd been stuck on that issue for a while. I don't suppose you'd also know how to print the content displayed in the iframe through DeltaV or HTML? With security already limiting cross-origin interactions to messages and EventListener, I haven't found it easy to generate a report filled by the operator in that iframe (v 14.3.1).
  • In reply to Andrew Daly:

    Sorry, I did not find a way either. I think it is the "allow-modals" sandbox setting of the Live display iframe that prevents a document.write () command. It would be good to see if someone has found a secure way of doing that. There might be a usable js library somewhere or a route via SQL and Live objects.