Execute weblink in channel table

Forum Home Forums Understanding the Software Using Formulas Execute weblink in channel table

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #16830
    CCKOH
    Participant

    Hi Mikhail,
    Good day to you.
    I’m wish to know is that possible to open weblink by using channel table like the link function on the scheme view? The purpose of I need to use on channel table is because I need to apply Object right to this particular channel only.
    I’m trying to set a channel as calculated output, output format: execute, output formula: URL:”www.exampledomain.com”, but this setting is not working.

    #16832
    manjey73
    Participant

    Probably not, it’s a plug-in for tables as part of PlgMain. Most likely, it needs to be improved

    #16833
    manjey73
    Participant

    For example, in addition to the “Rocket” – execute the command, you need to add something else. Or to add to this the ability to work with links.

    #16837
    Mikhail
    Moderator

    Hi,
    Scripts are executed on server side, so they have no connection with a web browser.
    How is the information expected to be presented to the end user?

    #16841
    CCKOH
    Participant

    Hi Mikhail,
    My idea here is to create a web application link on the channel table. The function of the application link is to shut down the machine. This feature cannot be accessed by everyone, only by the supervisor level. I’m thinking of applying object rights and roles on this calculated output channel and using the button on a scheme to execute this web application link. If the user logs in without the user rights and clicks the button, ‘Access Denied’ will be prompted by Rapid SCADA. The scheme is displayed in kiosk mode and I am setting it in Webstation so that it will be the first screen to load after login.

    #16848
    Mikhail
    Moderator

    Hi,
    You can create a channel with an output formula that executes an external script to shutdown the machine.
    But it’s not a good practice.

    #16849
    Mikhail
    Moderator

    To shut down a Linux machine it’s better to connect by SSH and execute a shell command.

    #16851
    CCKOH
    Participant

    Hi Mikhail,

    “You can create a channel with an output formula that executes an external script to shut down the machine.”

    Could you advise me on what formula can be applied to the output formula to execute the external script?
    For your information, I’ve set up an Nginx web server to listen to http://localhost:8080, which is the web application using a shell command to shut down the Linux machine. Do you have any ideas on how to incorporate http://localhost:8080 into the output formula so that when the output format is set to execute, it will open the link?
    Thank you.

    #16856
    Mikhail
    Moderator

    In the Scripts table add

    public double StartProcess()
    {
      Process.Start(@"/opt/scada/myscript.ssh");
      return 1.0;
    }

    and create myscript.ssh containing the necessary commands.
    Then use that function in the output formula.

    #16858
    CCKOH
    Participant

    Hi Mikhail,
    I tried using the Process.Start function with my .sh script, but it seems that this function does not support the command {xdg-open "$URL" >/dev/null 2>&1 &}, which is intended to open a web link. However, that’s fine; I’m just using the URL-link function in the scheme view, which is more convenient and straightforward. The only drawback is that we cannot set object and role restrictions on the specific web link itself.

    Thank you very much!

    #16868
    CCKOH
    Participant

    Hi Mikhail,
    Just for update, Process.Start function is able to run the shell script even with xdg-open command. The only thing is need to properly set the user access of the files.
    Thank you.

    #16876
    Mikhail
    Moderator

    Hi,
    That’s interesting!

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.