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);
I need to achieve the same results in an .NET application but am not sure what API functions to use.
Thanks a lot.
Solved! Go to Solution.
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;
for(int i = 0; i < timeSliceSize; i++)
args = i;
args = 0.0;
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.