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: 2020-06-30 09:13 PM . Last Modified: 2023-05-03 12:13 AM
What .NET API functions can I call to set values and length for the variable float array?
The ClearSCADA code looks like this. TimeSlices is a Variable Float Array.
IF samplecount > 0 THEN
TimeSlices.Value[TimeSlice] := Total/samplecount;
TimeSlices.Length := INT_TO_DINT(TimeSlices + 1);
END_IF
I need to achieve the same results in an .NET application but am not sure what API functions to use.
Thanks a lot.
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: 2020-07-01 01:31 AM
OK. I figured it out myself. To set value, I need to call SetElement()
private const string FUNC_SET_ELEMENT = "SetElement";
DBObject timeSliceObj = connection.GetObject(timeSliceFullPath);
//Initialise time slices.
object[] args = new object[2];
for(int i = 0; i < timeSliceSize; i++)
{
args[0] = i;
args[1] = 0.0;
timeSliceObj.InvokeMethod(FUNC_SET_ELEMENT, args);
}
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: 2020-07-01 01:31 AM
OK. I figured it out myself. To set value, I need to call SetElement()
private const string FUNC_SET_ELEMENT = "SetElement";
DBObject timeSliceObj = connection.GetObject(timeSliceFullPath);
//Initialise time slices.
object[] args = new object[2];
for(int i = 0; i < timeSliceSize; i++)
{
args[0] = i;
args[1] = 0.0;
timeSliceObj.InvokeMethod(FUNC_SET_ELEMENT, args);
}
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: 2020-07-01 04:12 AM
Yeah,
In regards to these items for the future, the schema is your friend 🙂
If you're looking to call a method on a particular Type of object in the database, you're best to find the methods that it has, starting in the schema at the leaf, and working your way back up the object hierarchy until you find the method that you were looking for.
Then InvokeMethod is the answer, passing in the arguments required, and handling the returned data.
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.