EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-09-30 11:07 PM
I am trying to pass generated data from scripting environment to variables used in Database. f
I have tried to run thes3 3 commands in script environment but have not had any success.
I want to pass data from script to database variables and vice versa.
I read Scada help thoroughly and tried to test examples in there, but it did not work.
I appreciate if any one help me to let me know if these 3 functions are exactly what I need? and is there any clear explanation about their functionality?
Thanks and Regards
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-10-01 06:44 AM . Last Modified: 2024-10-01 06:47 AM
You're on the right track. If I had to guess, you're probably just not supplying the property that you want to write to.
Here are some examples. Assume there's a variable string in a path called "Testing.StringVar"
Example 1: SetOPCValue -- sets a property of an object
call server.setopcvalue("Testing.StringVar.Value",someStringValueHere)
Example 2: GetOPCValue -- gets a property value for an object
myString = server.getopcvalue("Testing.StringVar.Value")
msgbox myString
Example 3: FindObject -- creates an object variable with access to all methods/properties of the object using the FULLNAME of an object
set obj = server.findobject("Testing.StringVar")
msgbox obj.interface.value
Example 4: LookupObject -- creates an object variable with access to all methods/properties of the object using the ID number of an object.
Lets assume the ID number for the StringVar tag is 54321
set obj = server.lookupobject(54321)
msgbox obj.interface.value
When you use FindObject or LookupObject, you're creating an object variable so you'll typically want to evaluate if the object returned something prior to the next statement. something like below would work:
set obj = server.findobject("Testing.StringVar")
if not obj is nothing then
'do something here (ex: msgbox obj.fullname)
end if
msgbox obj.interface.value
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-10-04 04:22 AM
None of the five screenshots in the previous post are visible - they just show a placeholder triangle shape.
For DNP3 points you can only control output points (analog and binary), control pulsed actions (null and trip-close) and initialise string points.
Using a script to set the current value of an output point will issue a control to the outstation. Attempting to set the current value of an input point will apply a master-station override (if enabled) and fail if disabled.
You can also do this by invoking the "Control" method, which is on the output point's "Control" aggregate:
Set Point = Server.FindObject("My DNP3 Analog Output Point")
Point.Interface.Control.Control 1234
where 1234 is the value to control the analog output point to.
For string points use the "SetValue" method:
Set Point = Server.FindObject("My DNP3 String Point")
Point.Interface.SetValue "Hello world"
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-10-01 06:44 AM . Last Modified: 2024-10-01 06:47 AM
You're on the right track. If I had to guess, you're probably just not supplying the property that you want to write to.
Here are some examples. Assume there's a variable string in a path called "Testing.StringVar"
Example 1: SetOPCValue -- sets a property of an object
call server.setopcvalue("Testing.StringVar.Value",someStringValueHere)
Example 2: GetOPCValue -- gets a property value for an object
myString = server.getopcvalue("Testing.StringVar.Value")
msgbox myString
Example 3: FindObject -- creates an object variable with access to all methods/properties of the object using the FULLNAME of an object
set obj = server.findobject("Testing.StringVar")
msgbox obj.interface.value
Example 4: LookupObject -- creates an object variable with access to all methods/properties of the object using the ID number of an object.
Lets assume the ID number for the StringVar tag is 54321
set obj = server.lookupobject(54321)
msgbox obj.interface.value
When you use FindObject or LookupObject, you're creating an object variable so you'll typically want to evaluate if the object returned something prior to the next statement. something like below would work:
set obj = server.findobject("Testing.StringVar")
if not obj is nothing then
'do something here (ex: msgbox obj.fullname)
end if
msgbox obj.interface.value
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-10-01 07:28 PM
Thank you so much
I have tested them all and regardless of which function I am using I am receiving this error message. I tried to change configuration in Webex in server configuration, but no success.
Any suggestion about this issue?
Thanks and regards
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-10-03 07:22 AM
Without seeing the script that generates this error there isn't sufficient information to go on.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-10-03 08:21 PM
Hi Andrew
These are test scripts to check Server Function outcomes.
X = Server.GetOPCValue("From_Scrpt.Value") Send value from Database to Script
Msgbox "The value from Database is:" & x: After I run the Script, the result will be:
z = Inputbox ("Insert the value:")
server.SetOPCValue "To_Script.Value" , Cint(z) Set database value from script
Msgbox "The value from Script is:" & To_Script.Value Display database value
but I can see the value in the box that I dragged from database to mimic.
These commands are only working for INTERNAL VARIABLES.
the main issue is thatI cannot send to DNP3 points to I can forward them to RTU?
Thanks and Regards
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-10-04 04:22 AM
None of the five screenshots in the previous post are visible - they just show a placeholder triangle shape.
For DNP3 points you can only control output points (analog and binary), control pulsed actions (null and trip-close) and initialise string points.
Using a script to set the current value of an output point will issue a control to the outstation. Attempting to set the current value of an input point will apply a master-station override (if enabled) and fail if disabled.
You can also do this by invoking the "Control" method, which is on the output point's "Control" aggregate:
Set Point = Server.FindObject("My DNP3 Analog Output Point")
Point.Interface.Control.Control 1234
where 1234 is the value to control the analog output point to.
For string points use the "SetValue" method:
Set Point = Server.FindObject("My DNP3 String Point")
Point.Interface.SetValue "Hello world"
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-10-07 03:44 PM
Dear Andrew
Thank you so much for your help.
I did not know about our data type limitation that we can use in these functions. Very helpful.
I have copied & pasted test codes for your reference, plus screen shots of outcomes.
1-READ Value from DATABASE:
X = Server.GetOPCValue("From_Scrpt.Value")
Msgbox "The value from DataBase is:" & x
2-WRITE Value to DATABASE:
z = Inputbox ("Insert the value:")
server.SetOPCValue "To_Script.Value" , Cint(z)
Msgbox "The value from Script is:" & To_Script
3-WRITE Value to DATABASE (DNP3):
set Point = Server.FindObject ("Control_Output")
Point.Interface.Control.Control 1234
Msgbox "The obj value is :" & Point.Interface.CurrentValue
I have attached outcome of running codes in attachment. There are 2 issues:
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.