When you talk about a individual subscribe reads and update of all subscriptions, I don't fully understand. I am thinking of subscriptions as applying to all the tags that are specified in the form controls, such as digital panel meters, push buttons, indicators, etc...
How do subscriptions apply to individual read writes inserted into a DataSubscriber data changed handler as in the example below?
When the DataSubscriber changed event occurs, it severely bogs down the other form controls, event though I have them on separate EthernetIPforCLXCom .NET Components.
Sorry for the long code example, I don't know how to post it in that scrolling window.
thanks!
Example:
Private Sub DataSubscriber_PLCFunctions_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber_PLCFunctions.DataChanged
Dim n_strMessage As String = String.Empty
Dim strPLCTagAddress As String
Dim strWriteValue As String
Dim strResultsCycleDintValues(10) As String
Dim strResultsCycleRealValues(10) As String
Try
strPLCTagAddress = "PCNotFaulted"
strWriteValue = g_PLCWriteValues.PC_NotFaulted.ToString
EthernetIPforCLXCom_MainForm.Write(strPLCTagAddress, strWriteValue)
strPLCTagAddress = "PCStartManualHipotTest.0"
strWriteValue = g_PLCWriteValues.StartManualHipotTest.ToString
EthernetIPforCLXCom_MainForm.Write(strPLCTagAddress, strWriteValue)
strPLCTagAddress = "DixellDownloadComplete"
strWriteValue = g_PLCWriteValues.DixellDownloadComplete.ToString
EthernetIPforCLXCom_MainForm.Write(strPLCTagAddress, strWriteValue)
g_bPLCFunctions_WritePLCValues = False
n_longElapsedWrite = tmrElapsedWrite.GetTimeExpiredInMilliseconds
strPLCTagAddress = "StepNumber"
g_PLCReadValues.PLCStageCounterValue = EthernetIPforCLXCom_MainForm.Read("StepNumber")
strPLCTagAddress = "DI_MCRStatus.InDbncd"
g_PLCReadValues.MCR = EthernetIPforCLXCom_MainForm.Read("DI_MCRStatus.InDbncd")
strPLCTagAddress = "DI_HiPotPass.InDbncd"
g_PLCReadValues.HipotPass = EthernetIPforCLXCom_MainForm.Read("DI_HiPotPass.InDbncd")
strPLCTagAddress = "DI_HiPotFail.InDbncd"
g_PLCReadValues.HipotFail = EthernetIPforCLXCom_MainForm.Read("DI_HiPotFail.InDbncd")
strPLCTagAddress = "DI_AirPressureSwitch.InDbncd"
g_PLCReadValues.AirPressureSwitch = EthernetIPforCLXCom_MainForm.Read("DI_AirPressureSwitch.InDbncd")
strPLCTagAddress = "DI_RejectResetPB.InDbncd"
g_PLCReadValues.RejectPB = EthernetIPforCLXCom_MainForm.Read("DI_RejectResetPB.InDbncd")
strPLCTagAddress = "DI_MotorContinuity_1.InDbncd"
g_PLCReadValues.SinglePhaseContinuity = EthernetIPforCLXCom_MainForm.Read("DI_MotorContinuity_1.InDbncd")
strPLCTagAddress = "DI_MotorContinuity_2.InDbncd"
g_PLCReadValues.ThreePhaseContinuity = EthernetIPforCLXCom_MainForm.Read("DI_MotorContinuity_2.InDbncd")
strPLCTagAddress = "DI_MOLTripped.InDbncd"
g_PLCReadValues.MOLTripped = EthernetIPforCLXCom_MainForm.Read("DI_MOLTripped.InDbncd")
strPLCTagAddress = "AI_Volts.EngineeringValue"
g_PLCReadValues.VoltsScaled = EthernetIPforCLXCom_MainForm.Read("AI_Volts.EngineeringValue")
g_PLCReadValues.VoltsScaled = Math.Round(g_PLCReadValues.VoltsScaled, 2)
strPLCTagAddress = "AI_Amps.EngineeringValue"
g_PLCReadValues.AmpsScaled = EthernetIPforCLXCom_MainForm.Read("AI_Amps.EngineeringValue")
g_PLCReadValues.AmpsScaled = Math.Round(g_PLCReadValues.AmpsScaled, 2)
strPLCTagAddress = "AI_DischargePressure.EngineeringValue"
g_PLCReadValues.DischargePressureScaled = EthernetIPforCLXCom_MainForm.Read("AI_DischargePressure.EngineeringValue")
g_PLCReadValues.DischargePressureScaled = Math.Round(g_PLCReadValues.DischargePressureScaled, 2)
strPLCTagAddress = "DO_GreenDomeLight.Output"
g_PLCReadValues.GreenDomeLight = EthernetIPforCLXCom_MainForm.Read("DO_GreenDomeLight.Output")
strPLCTagAddress = "DO_AmberDomeLight.Output"
g_PLCReadValues.AmberDomeLight = EthernetIPforCLXCom_MainForm.Read("DO_AmberDomeLight.Output")
strPLCTagAddress = "DO_RedDomeLight.Output"
g_PLCReadValues.RedDomeLight = EthernetIPforCLXCom_MainForm.Read("DO_RedDomeLight.Output")
strPLCTagAddress = "DO_DomeLightAlarm.Output"
g_PLCReadValues.DomeLightAlarm = EthernetIPforCLXCom_MainForm.Read("DO_DomeLightAlarm.Output")
strPLCTagAddress = "MachineFaults.HiPotTesterFault"
g_PLCReadValues.HiPotTesterFault = EthernetIPforCLXCom_MainForm.Read("MachineFaults.HiPotTesterFault")
strPLCTagAddress = "MachineFaults.AirSupplyFault"
g_PLCReadValues.AirSupplyFault = EthernetIPforCLXCom_MainForm.Read("MachineFaults.AirSupplyFault")
strPLCTagAddress = "MachineFaults.ParameterFault"
g_PLCReadValues.ParameterFault = EthernetIPforCLXCom_MainForm.Read("MachineFaults.ParameterFault")
strPLCTagAddress = "MachineFaults.PCFault"
g_PLCReadValues.PCFault = EthernetIPforCLXCom_MainForm.Read("MachineFaults.PCFault")
strPLCTagAddress = "MachineFaults.ContinuityFault"
g_PLCReadValues.ContinuityFault = EthernetIPforCLXCom_MainForm.Read("MachineFaults.ContinuityFault")
strPLCTagAddress = "MachineFaults.NoPowerFault"
g_PLCReadValues.NoPowerFault = EthernetIPforCLXCom_MainForm.Read("MachineFaults.NoPowerFault")
strPLCTagAddress = "MachineFaults.MOLTripped"
g_PLCReadValues.MOLTrippedFault = EthernetIPforCLXCom_MainForm.Read("MachineFaults.MOLTripped")
strPLCTagAddress = "MasterReset"
g_PLCReadValues.MasterReset = EthernetIPforCLXCom_MainForm.Read("MasterReset")
strPLCTagAddress = "TestCycleTime.ACC"
g_PLCReadValues.TestCycleTime = EthernetIPforCLXCom_MainForm.Read("TestCycleTime.ACC")
strPLCTagAddress = "Results.CycleDintValues[0]"
strResultsCycleDintValues = EthernetIPforCLXCom_MainForm.Read("Results.CycleDintValues[0]", 10)
strPLCTagAddress = "Results.CycleRealValues[0]"
strResultsCycleRealValues = EthernetIPforCLXCom_MainForm.Read("Results.CycleRealValues[0]", 10)
strPLCTagAddress = "Results.PassFailCode"
g_PLCReadValues.PassFailValue = EthernetIPforCLXCom_MainForm.Read("Results.PassFailCode")
strPLCTagAddress = "SolenoidRequirementComplete"
g_PLCReadValues.SolenoidInstallComplete = EthernetIPforCLXCom_MainForm.Read("SolenoidRequirementComplete")
Catch ex As Exception
n_strMessage = "Procedure MainForm: DataSubscriber1_DataChanged failed with error: " & vbCrLf & ex.Message & vbCrLf & strPLCTagAddress
MsgBox(n_strMessage)
End Try
End Sub