EnglishУкраїнськаmRussian
Login/New
Topic with many replies

Command/message from openSCADA to some device in network


First | 1 | 2 |
Author Message
Written on: 18. 11. 2013 [10:59]
roman
Roman Savochenko
Moderator
Contributor
Developer
registered since: 12.12.2007
Posts: 3750
"ajinkya" wrote:

As i mentioned in previous thread, I have my customized front-end ready(with your help :-) ), it can be seen in attachment.

In the attached image there is one button named "wake up". So on that button press event I want to call the system function
ether wake -->> sysCall("etherwake -i eth0 <MAC address>"); <<--

As of now it only seen working in front end , like it changes its color, text on the button to "Turn off" and the status message too, but nothing is written to execute the actual command like "etherwake -----" or "net rpc shutdown --------"

So I want your guidance on this.

Did you try and read here about SYS.system()?

Learn, learn and learn better than work, work and work.
Written on: 19. 11. 2013 [08:27]
ajinkya
Ajinkya Biradar
Topic creator
registered since: 17.12.2012
Posts: 23
Hello Sir,
I have read the 5.2. System (SYS) but I got it partially,

from all of the object functions listed I think the below more relevant -

-->> string system( string cmd, bool noPipe = false ); <<--

particularly, is this, the command written below, the correct way to use it?

-------------------------------------------------------------------
string system(string etherwake -i eth0 <MAC address>)
-------------------------------------------------------------------

Also I need to call a script, so it will be beneficial as it supports script calls too, as mentioned in the brief explanation on the link.
Furthermore, while trying it, I should use it in Java-like based calculator, right?
Are there any example scripts, for 5.2. System (SYS) / SYS.system()? , used in AGLKS project? as I am using that project for my understanding of openSCADA

Thank you for your quick response. :-)

Written on: 20. 11. 2013 [09:09]
roman
Roman Savochenko
Moderator
Contributor
Developer
registered since: 12.12.2007
Posts: 3750
"ajinkya" wrote:

particularly, is this, the command written below, the correct way to use it?
-------------------------------------------------------------------
string system(string etherwake -i eth0 <MAC address>)
-------------------------------------------------------------------

You are wrong but main argument to "system()" is "string" and you try send some wrong!
And "system()" belong to the object SYS!
The correct line will:
JAVASCRIPT
SYS.system("/usr/sbin/etherwake -i eth0");

Continue reading the language JavaLikeCalc for understanding!

Learn, learn and learn better than work, work and work.
Written on: 26. 12. 2013 [09:32]
ajinkya
Ajinkya Biradar
Topic creator
registered since: 17.12.2012
Posts: 23
hello sir,
Is there any way to change the things(ex. text, color, etc) in user interface front-end on "button value" instead of "button press event i.e --> ws_BtPress:".

I have added one line in the front end code but it is not taking effect.... neither it is taking any effect.

Kindly have a look at the image added.

or
if making things change in user interface front-end on "button value" is not possible.....

can we use the same button press event in "Java-like based calculator", which we used while creating widget..... if yes then how do I do it ?

Thankyou,

Wish you happy new year in advance..... :) and merry Christmas too ...



[This article was edited 2 times, at last 26.12.2013 at 11:26.]
Attachment

query_backend_1.png (File type: image/png, Size: 224.92 kilobytes) — 2200 downloads
Written on: 26. 12. 2013 [22:47]
roman
Roman Savochenko
Moderator
Contributor
Developer
registered since: 12.12.2007
Posts: 3750
"ajinkya" wrote:

Is there any way to change the things(ex. text, color, etc) in user interface front-end on "button value" instead of "button press event i.e --> ws_BtPress:".

For buttons events processing is single way exclude check-button where you can get the "value" attribute.

"ajinkya" wrote:

I have added one line in the front end code but it is not taking effect.... neither it is taking any effect.

Sure, you are wrong and no real process any events but place your code into events processing loop.
For examples see to test form's elements where some button's events process.

But bellow you have true processing for event from button "CN1_Bt1" but why you comment next line and don not place all three lines to single condition like:
JAVASCRIPT
if(ev_cur == "wsBtPress:/CN1_Bt1")
{
  //line1
  //line2
  //line3
}


At all you can observe for what events pass by place print test messages code before your problem's line like that:
JAVASCRIPT
SYS.messInfo("TEST Wdg","Event: "+ev_cur);

And see next to console or messages archive: http://wiki.oscada.org/HomePageEn/Doc/ProgrammManual/part4/files?get=subsys_arch_mess_en.png

"ajinkya" wrote:

Wish you happy new year in advance..... :) and merry Christmas too ...

Thanks, and you!

Learn, learn and learn better than work, work and work.
First | 1 | 2 |



4323