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
84650members
353989posts

Using ServerObject.Interface to read array-based properties

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.

Solved
rlao
Lieutenant
Lieutenant
0 Likes
3
1534

Using ServerObject.Interface to read array-based properties

Hi all,

 

Is it at all possible to read array-based properties using ServerObject.Interface in Scripting?

 

I am trying to read out the VectorValues property of a CProfileFloat profile object and populate a Form with the individual array values.

 

I can't get ServerObject.Interface to work at all as it complains about type mismatches.

 

I was doing something like:

 

Set FlowProfile = Server.FindObject(sFlowProfilePointFullName)

Vector1 = FlowProfile.Interface.VectorValues(0)

 

which did not work.

 

What is the correct way to do this?


Accepted Solutions
AndrewScott
Commander
Commander
1
1521

Re: Using ServerObject.Interface to read array-based properties

The following JScript example works in a mimic script:

 

var Profile = Server.FindObject( "Time Profiles.Float" );
var Values = Profile.Interface.VectorValues;
var Times = Profile.Interface.VectorTimes;

var FirstValue = Values.getItem(0);
var FirstTime = Times.getItem(0);

 

I've not tried this from VBScript.

 


Andrew Scott, Lead Engineer, AVEVA

See Answer In Context

3 Replies 3
BevanWeiss
Spock
Spock
0
1530

Re: Using ServerObject.Interface to read array-based properties

@rlao works for me...

 

Dim scxServer As ScxV6Server
Set scxServer = New ScxV6Server
scxServer.Connect "Test", "superuser", "superusersuperuser"
Dim objDoubleArray As ScxV6Object
Set objDoubleArray = scxServer.FindObject("New Float")

Dim arrDoubleArray
arrDoubleArray = objDoubleArray.Property("VectorValues")

 

[apologies for bad variable names etc etc... definitely awkward having an array called 'arrDoubleArray' that is full of 'Singles' ;)]


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
AndrewScott
Commander
Commander
1
1522

Re: Using ServerObject.Interface to read array-based properties

The following JScript example works in a mimic script:

 

var Profile = Server.FindObject( "Time Profiles.Float" );
var Values = Profile.Interface.VectorValues;
var Times = Profile.Interface.VectorTimes;

var FirstValue = Values.getItem(0);
var FirstTime = Times.getItem(0);

 

I've not tried this from VBScript.

 


Andrew Scott, Lead Engineer, AVEVA
rlao
Lieutenant
Lieutenant
0 Likes
0
1511

Re: Using ServerObject.Interface to read array-based properties

Hi Andrew,

 

I'm trying to do this in VBScript, but your reply actually helped me figure out what I was doing wrong.

 

Basically, in addition to what I was doing in my original post, I was also trying to read VectorValues out into a ReDim variable sized to the MaxVectors of the float profile. Turns out that doesn't work and the solution was actually much, much simpler than what I was trying to do.

 

It was more or less like your JScript answer:

 

Set FlowProfile = Server.FindObject(sFlowProfileFullName)
Dim FlowArray
FlowArray = FlowArray.Interface.VectorValues

Flow1 = FlowArray(0)
Flow2 = FlowArray(1)
Flow3 = FlowArray(2) etc...

 

Extremely simple and I can't believe it took me this long to figure out.