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