Bulk Link Marking - Possible?

I have a controller with points pulled in for multiple AHUs.

As part of a project, I have created a folder in my station with a folder structure and naming convention. The points for the AHUs have been recreated within this folder.

Is there a way to bulk link mark the out from the points in the controller to the in10 of the points created in the folder, or does this need linking one by one?

Example:

Controller Point Folder Point

AHU1 Sup Fan —> SupFanCmd

AHU1 Sup Temp → SupTemp

Hope that makes sense :smiley:

Thank you

Yes, you can do this in a program object.

1 Like

I thought that would be the answer. Is it time-consuming if you know what you’re doing?

I’ve had a change of plan, but I’ll need to learn for future issues!

It won’t take terribly long to make it.

1 Like

Piggyback on this thread to learn :slight_smile: .

1 Like

I know you’re a busy guy but if you find some time to create a small sample it would be greatly appreciated :smiley:

Here’s what i use to make Many to Many links:


public void onExecute() 
  throws Exception
{
  // Create a new thread, with the starting point set as the current program 
  // object.
  Thread thread = new Thread(this, getComponent().getName());
  
  // Start the thread
  thread.start();
}

public void run()
{
  // This task will take a long time
  {
    System.out.println("started task ["+Thread.currentThread().getName()+"]");
    try
    {
      BOrd fromQuery = getFromQuery().getOrd();
      BITable from = (BITable)fromQuery.resolve().get();
      @SuppressWarnings({ "unchecked" }) //hides the unchecked warning since we're not typeChecking
      TableCursor<BNumericSet> fromQ = from.cursor(); //<----Change This
      

      BOrd toQuery = getToQuery().getOrd();
      BITable to = (BITable)toQuery.resolve().get();
      @SuppressWarnings({ "unchecked" }) //hides the unchecked warning since we're not typeChecking
      TableCursor<BNumericWritable> toQ = to.cursor();//<----Change This



      BComponent component;
      BLink link;
      BConversionLink link1;
      BConverter converter;
      BNumericSet sourcePoint;//<----Change This
      BNumericWritable targetPoint;//<----Change This
      String ordString;
      while(fromQ.next() && toQ.next())
      {
        //instanciate both blocks
        sourcePoint = fromQ.get();
        targetPoint = toQ.get();
        converter = new BStatusNumericToNumber();//<----Maybe change This
        ordString = "station:|" + sourcePoint.getSlotPathOrd().toString();
        //link1 = new BConversionLink( BOrd.make(ordString), "out", "highLimit", true,converter);//<----Maybe change This
        link = new BLink( BOrd.make(ordString), "out", "in10", true); //<----Maybe Change This
        targetPoint.add("MassAddedLink?", link); //Change Link Slot name incase you need to delete them. also update link to link1 if using converter
      }
        
    } catch (Exception e) {
      System.out.println("[CRITICAL: "+e+"]");
    }
    System.out.println("ended task ["+Thread.currentThread().getName()+"]");
  }
}

You do have to change “TableCursor” type to what the source and target types are. If you need a conversion link, you will need to comment in that part, comment out regular link, and also change converter type as needed.

1 Like