Forum Home › Forums › Development and Integration › JavaScript API example custom page
Tagged: Rapidscada logged user
- This topic has 36 replies, 4 voices, and was last updated 3 years ago by
Mikhail.
-
AuthorPosts
-
December 22, 2021 at 12:31 pm #9819
BrainBranchetti99ParticipantI 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.December 22, 2021 at 12:38 pm #9820
MikhailModeratorHi,
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.
December 22, 2021 at 12:40 pm #9821
MikhailModeratorThe above is not true. Web page view also contain the rotating image.
Anyway, press F12 and check errors in the browser console.December 22, 2021 at 1:00 pm #9822
BrainBranchetti99ParticipantYou’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.pngTHANK YOU SO MUCH
December 23, 2021 at 9:16 am #9824
BrainBranchetti99ParticipantGood morning,
I realized that I was missing the ClientApiSvc.svc file in the custom folderHow do you write a value? Do the reverse?
December 23, 2021 at 9:50 am #9825
BrainBranchetti99ParticipantIt’s possibile to write data with the clientApi?
December 23, 2021 at 1:20 pm #9828
MikhailModeratorA 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.December 23, 2021 at 1:53 pm #9829
BrainBranchetti99ParticipantYes, I definitely need to be able to send the data too.
Let me know what to do in order to set up the communication.December 23, 2021 at 1:55 pm #9830
BrainBranchetti99Participant> 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
December 24, 2021 at 12:05 pm #9831
MikhailModerator> 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 🙂December 27, 2021 at 1:47 pm #9832
BrainBranchetti99ParticipantHello,
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.
December 27, 2021 at 2:16 pm #9833
MikhailModeratorHi,
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 exampleApril 5, 2022 at 5:57 am #10150
BrainBranchetti99ParticipantThe 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
April 5, 2022 at 11:21 am #10151
MikhailModeratorUse getCurCnlDataExt
April 7, 2022 at 1:35 pm #10157
BrainBranchetti99ParticipantI’m having trouble understanding how it works.
Would you have some practical examples?Thank you.
-
AuthorPosts
- You must be logged in to reply to this topic.