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: 2019-11-28 10:28 PM . Last Modified: 2023-05-03 12:20 AM
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?
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: 2019-11-29 01:33 AM
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.
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: 2019-11-28 11:26 PM . Last Modified: 2019-11-29 02:12 AM
@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' ;)]
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: 2019-11-29 01:33 AM
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.
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: 2019-11-29 03:15 AM
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.
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.