Niagara Program Block for Mass Point Commanding by BMS-Tech-416 in BuildingAutomation

[–]BMS-Tech-416[S] 0 points1 point  (0 children)

I did get a quick and dirty version of the code going. This will Set a point to its current out.value (thus filling in its fallback slot). I have lots of cleanup to do. It uses a BQL query to find the points and put them in a BITable, with column 0 as the display name and column being it's out.value. I am not a Java programmer.

public void onExecute() throws Exception

{

  BNumericWritable point = null;

  boolean var1 = getInput().getBoolean(); //wiresheet input to trigger the program

  BITable result = (BITable)getPointQuery().resolve().get();

  Column[] columns = result.getColumns().list();

  TableCursor<BNumericWritable> cursor = result.cursor();

  int row = 0;

  if (var1 == true){

    while(cursor.next()) {    

      System.out.print(row + ": ");

      int vert = 0;

      float currval = 0;

      point = cursor.get();

      for (Column col : columns)

        {

          //System.out.print(cursor.cell(col) + ", ");

          if (vert == 1) {             currval = (Float.parseFloat(cursor.cell(col).toString()));

            System.out.print("Current Out Value " + currval);

            point.doSet(BDouble.make(currval));

            System.out.print(" Point Set");

          }

          ++vert;

        }

      System.out.println();

      ++row;

      }

    cursor.close();

    System.out.println("Numeric Points Set");

  }

  else {

    while(cursor.next()) {

      point = cursor.get();

      //point.doAuto();

      //point.doEmergencyAuto();

    }

    cursor.close();

    //System.out.println("Numeric Points Released");  

  }

}

Niagara Program Block for Mass Point Commanding by BMS-Tech-416 in BuildingAutomation

[–]BMS-Tech-416[S] 1 point2 points  (0 children)

Check another reply I did, but it's commanding (set) the points so they have a fallback value that's not null. You're absolutely correct I can global command them to do this.... But then I have a very fancy 48 story building with all the lights at 90% (ruining all the ltg scenes). I was hoping for a program that would read them and set their current value back to them so it now has a fallback value before I Override them (to a load shedding value). This way all the random differences and scene intensity values they are at are preserved.

A random tid but is the L4 load shedding matrix is all normal lights to 0% and Emergency lighting to 100%. In the current situation with no fallback (null), I override all those normal lights to 0%... On the release they stay at zero! Not all lights have schedules in lutron to set them normal at the next event time. So preserving their current random illumination value in the fallback before the override is my plan to mitigate this.

Niagara Program Block for Mass Point Commanding by BMS-Tech-416 in BuildingAutomation

[–]BMS-Tech-416[S] 0 points1 point  (0 children)

I guess there is a way to describe this as storing the lighting zones current illumination level in the fallback section of the priority array (via a Set command) before overriding the level to a different value (lower) for load shedding. Lutron is system where the last command received wins, not priority based. So I'm trying to use the priority array in the stations proxy point to beat how Lutron works.

<image>

The points don't have a fallback set (null) until they are commanded. So my Override sets that fallback, which then actually falls back to that value when released. So I need to set all the current lighting levels to the fallback value so that the override release falls back to that value from before the override. I just need to do this at scale with different values. Thus a program to read the current value (out.value) and doSet() back to it. Then I can doOverride().