JavaScript API example custom page

Forum Home Forums Development and Integration JavaScript API example custom page

Viewing 15 posts - 1 through 15 (of 37 total)
  • Author
    Posts
  • #9819
    BrainBranchetti99
    Participant

    I have some problem with the JavaScript API example.

    I try to read the data from Rapid Scada in my custom page.

    When I try to read the data with the “Helloworld” sample project from the data channel of the simulator 101.
    Channel 101 changes, I think the data is correct.

    But it doesn’t work, I didn’t see any results / errors from JavaScript ..
    I can see the page simply by searching for the page on the browser with /custom/MyPage.html
    If I use the web app, keep rotating the upload without showing the example page.

    #9820
    Mikhail
    Moderator

    Hi,

    Rotating GIF is a part of scheme view. I suppose, the link is incorrect. You should press F12 in browser and check what if the address of iframe.

    #9821
    Mikhail
    Moderator

    The above is not true. Web page view also contain the rotating image.
    Anyway, press F12 and check errors in the browser console.

    #9822
    BrainBranchetti99
    Participant

    You’re right it must be an iframe problem

    I don’t understand what the console error means, is this what you meant?

    I leave to you the error that i find:
    https://i.postimg.cc/9Qqj1kxv/Immagine.png

    THANK YOU SO MUCH

    #9824
    BrainBranchetti99
    Participant

    Good morning,
    I realized that I was missing the ClientApiSvc.svc file in the custom folder

    How do you write a value? Do the reverse?

    #9825
    BrainBranchetti99
    Participant

    It’s possibile to write data with the clientApi?

    #9828
    Mikhail
    Moderator

    A custom page should not be accessed by disk path like C:\SCADA… It should be accessed by a relative link like shown in the example (see readme.txt) https://github.com/RapidScada/scada-community/tree/master/Plugins/CustomPageExample

    > It’s possibile to write data with the clientApi?
    The API does not include sending commands function due to security reasons. You need to develop a plugin using C# that provides web service to send commands. We can do it by a contract if needed.

    #9829
    BrainBranchetti99
    Participant

    Yes, I definitely need to be able to send the data too.
    Let me know what to do in order to set up the communication.

    #9830
    BrainBranchetti99
    Participant

    > A custom page should not be accessed by disk path like C: \ SCADA… It should be accessed by a relative link like shown in the example (see readme.txt)

    I did exactly as the test example says and it works fine. I always log in via the scada web app

    #9831
    Mikhail
    Moderator

    > Let me know what to do in order to set up the communication.
    Replied by email.

    > I did exactly as the test example says and it works fine
    Good 🙂

    #9832
    BrainBranchetti99
    Participant

    Hello,

    if it is not a problem for you could we discuss the following possibilities?
    1. Send commands using the existing web form which could be opened from your custom form.
    2. Use scheme views for displaying data.

    Where can I find test examples to understand how to do it?
    Thank you so much for the great support.

    Davide.

    #9833
    Mikhail
    Moderator

    Hi,

    Sending commands is available from scheme views and table views. I suggest to right-click a view in browser, open source code, and check its JavaScript.
    Code example

    #10150
    BrainBranchetti99
    Participant

    The following function:
    scada.clientAPI.getCurCnlData(CNL_NUM, function (success, cnlData){ …..

    allows the reading of only one variable at a time. Is there a function that allows the reading of several variables at the same time? Thank you

    #10151
    Mikhail
    Moderator
    #10157
    BrainBranchetti99
    Participant

    I’m having trouble understanding how it works.
    Would you have some practical examples?

    Thank you.

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