- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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
.NET API for variable float array
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.
- Labels:
-
SCADA
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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);
}
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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);
}
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
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..
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.

