'Get the common part for the references. Dim dataSource As String; dataSource = "InControl.tagname.T" + StringRight(Me.Tagname, 3); 'Configure inlet valve 1. Me.Inlet1.CLS.InputSource = dataSource + "_IV1_CLS"; Me.Inlet1.OLS.InputSource = dataSource + "_IV1_OLS"; Me.Inlet1.CmdOpen.OutputDest = dataSource + "_IV1_CmdOpen"; 'Configure inlet valve 2. Me.Inlet2.CLS.InputSource = dataSource + "_IV2_CLS"; Me.Inlet2.OLS.InputSource = dataSource + "_IV2_OLS"; Me.Inlet2.CmdOpen.OutputDest = dataSource + "_IV2_CmdOpen"; 'Configure outlet valve. Me.Outlet.CLS.InputSource = dataSource + "_OV_CLS"; Me.Outlet.OLS.InputSource = dataSource + "_OV_OLS"; Me.Outlet.CmdOpen.OutputDest = dataSource + "_OV_CmdOpen"; 'Configure transfer pump 1. Me.Pump1.FlowSwitch.InputSource = dataSource + "_TP1_FlowSwitch"; Me.Pump1.CmdStart.OutputDest = dataSource + "_TP1_CmdStart"; 'Configure transfer pump 2. Me.Pump2.FlowSwitch.InputSource = dataSource + "_TP2_FlowSwitch"; Me.Pump2.CmdStart.OutputDest = dataSource + "_TP2_CmdStart"; 'Configure level meter. Me.LIT.PV.Input.InputSource = dataSource + "_LT_PV"; 'Configure temperature transmitter. Me.TT.PV.Input.InputSource = dataSource + "_TT_PV"; 'Configure agitator. Me.Agitator.AuxContact.InputSource = dataSource + "_AG_AuxContact"; Me.Agitator.CmdStart.OutputDest = dataSource + "_AG_CmdStart"; Me.Agitator.Speed.InputSource = dataSource + "_AG_Speed"; Me.Agitator.SpeedSP.InputSource = dataSource + "_AG_SpeedSP";