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
84549members
353805posts

.NET API for variable float array

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
Kan
Ensign
Ensign
0 Likes
2
946

.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.

Tags (1)

Accepted Solutions
Kan
Ensign
Ensign
0 Likes
1
935

Re: .NET API for variable float array

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);
}

See Answer In Context

Tags (1)
2 Replies 2
Kan
Ensign
Ensign
0 Likes
1
936

Re: .NET API for variable float array

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 (1)
BevanWeiss
Spock
Spock
0 Likes
0
929

Re: .NET API for variable float array

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 (1)