PointSetMultiple (function)

Syntax PointSetMultiple point1[,point2[,point3…]]
Description Performs setpoints for up to 30 points in a single setpoint request. If a failure occurs the function returns false, otherwise true is returned.
Comments If you need to set the value of multiple points, use this function rather than issuing multiple single setpoint requests for faster script execution. The point ErrCode property will be set to a non-zero value for a setpoint that failed. The point ErrMsg property will contain the associated error message.

There are two variants of PointSetMultiple. The first variant takes all the points declared in the argument list. The second variant takes an array.

Example 1

This example in Basic demonstrates both variants, argument list and array.

Sub Main()
       Dim status As Boolean
       Dim sp1 As New Point: sp1.Id = "SP1"
       Dim sp2 As New Point: sp2.Id = "SP2"
       Dim sp3 As New Point: sp3.Id = "SP3"
       Dim sp4 As New Point: sp4.Id = "SP4"
sp1.Value = 1
sp2.Value = 2
sp3.Value = 3
sp4.Value = 4
status = PointSetMultiple(sp1,sp2,sp3,sp4)
       If status = False Then
              If sp1.ErrCode <> 0 Then
                     MsgBox sp1.ErrMsg
              End If
       End If
               ’r; Using an array
Dim points(1 To 4) As Point
Set points(1) = sp1
Set points(2) = sp2
Set points(3) = sp3
Set points(4) = sp4
status = PointSetMultiple(points)
End Sub
Example 2 This example in C# demonstrates only the array variant.
using System;
using System.Collections.Generic;
using Proficy.CIMPLICITY;
public class GetSetNET
{
   public void Main()
    {
           int status;
            Point[] array = new Point[4];
            using (Point sp1 = new Point(),sp2 = new Point(),sp3 = new Point(),sp4 = new Point())
                                {
                  sp1.Id = "SP1";
                  sp2.Id = "SP2";
                  sp3.Id = "SP3";
                  sp4.Id = "SP4";
                  array[0] = sp1;
                  array[1] = sp2;
                  array[2] = sp3;
                  array[3] = sp4;
                  sp1.Value = 1;
                  sp2.Value = 2;
                  sp3.Value = 3;
                  sp4.Value = 4;
                  status = Cimplicity.PointSetMultiple(array);
                                }
    }
}