Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84248members
353348posts

[Imported] ValidateConfiguration method for CDBObject

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

sbeadle
Janeway Janeway
Janeway
0 Likes
0
271

[Imported] ValidateConfiguration method for CDBObject

>>Message imported from previous forum - Category:Scripts and Tips<<
User: mchartrand, originally posted: 2018-10-25 19:13:28 Id:275
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

_______

**_Von:
Hey all:
What is the intended use for ValidateConfiguration? To "Save" an object?
I tried calling the method in script and it doesn't do anything.._**

________________________

dmercer:
Hi Von,

Did you find that method in the database schema? (http://localhost/schema/CDBObject)

The description there seems to cover it.
ValidateConfiguration Validate Configuration Validates the configuration of the object and returns an array of error strings. Control

[retval] Errors (Array of String) : An array of returned error strings.

So if there is nothing wrong with an objects configuration, then it should return nothing or an empty array.

___________________________

**_Von:
I should clarify: my subroutine exits as soon as this method gets called, when it still has a list of objects to loop through._**

_____________

AWoodland:
Do you have any error handling set in your script (i.e. On Error Goto Something), it may be throwing a runtime error and redirecting you elsewhere.

___________________

bevanweiss:
As Adam said, we need more information.
If you can provide us a excerpt of your code it will help

______________

**_Von:
Thanks for the replies everyone.
The code is real simple:_**


_sTesting = oMyObject.Interface.ValidateConfiguration_

**_and I have a MSGBOX just before this line to ensure the object is correct._**

_________

dmercer:
I just tried this myself and got it to work. There is a folder called "Test script" which contains a DNP3 binary input called "New Binary Input Point". Below is the script.

_Public Function TestValidate
Dim oErrorArray
Dim oPoint
Set oPoint = Server.FindObject("Test script.New Binary Input Point")
If Not (oPoint Is Nothing) Then
oErrorArray = oPoint.Interface.ValidateConfiguration
End If
End Function_


___________________________

bevanweiss:
Given that your sample code doesn't appear to show any looping... I suspect the problem is that you aren't performing any looping 😉

If you are expecting it to perform this action for each object in some list of objects you have, you will need to supply more code... like where you create that list of objects, and how you are looping through those objects.

oMyObject is a single DBObject object... if you are passing in a CGroup object then you should expect the ValidateConfiguration result to be incredibly boring... there's not much that can go wrong with CGroup configuration (apart from Redirection List stuff).

If you want to validate the configuration of every object within a CGroup instead... well then you need to do either iteration / recursion to visit each object and call this method explicitly on each.

________________________

dmercer:
The sample code that I wrote was just to check the concept and to give Von something to compare to, because it sounds like something in his version is causing it to throw an error and terminate. I was just checking the result via the debugger.

_______________________________

**_Von:
Also, I'm trying to perform this method on "broken" cdatasetrows ( If you go "Display Data" on these rows, a "Fail to get data" query error that can be fixed by re-saving this row) - too bad there is no error log to view for vbscript subroutines..._**

_______

bevanweiss:
Dean: I did mean the 'sample code' that Von supplied

_sTesting = oMyObject.Interface.ValidateConfiguration_

There's no looping there...

Von:
So how are you looping through all the individual data set rows?
That's where the actual Configuration Errors are held... so you'd need to iterate through each one to identify these errors.