3
« on: December 08, 2022, 11:04:51 AM »
Archie,
I can see the m_ComComponent variable being used in the "DataSubscriber2" class and the "Datalogger2" inherits from it.
I assume it depend s on the following: "Imports System.ComponentModel" at the top of the "DataSubsriber2" class.
Below is what I have in the "Datalogger2" class, with the write statement below the comment ' set the read flag complete on the PLC tag
Private Sub StoreValue()
Try
If Not m_PauseLogging Then
Dim StringToWrite As String = m_Prefix
If m_TimeStampFormat IsNot Nothing AndAlso (String.Compare(m_TimeStampFormat, "") <> 0) Then StringToWrite &= Date.Now.ToString(m_TimeStampFormat)
For Each item In PLCAddressValueItems
If item.ScaleFactor = 1 Then
StringToWrite &= "," & item.LastValue '& item.Name & ":"
Else
Try
StringToWrite &= "," & item.LastValue * item.ScaleFactor ' & item.Name & ":"
Catch ex As Exception
StringToWrite &= "," & "INVALID-Check scale factor-" & item.LastValue
End Try
End If
Next
sw.WriteLine(StringToWrite)
sw.Flush()
' set the read flag complete on the PLC tag
If m_ComComponent IsNot Nothing Then
'MainForm.EthernetIPforCLXCom1.Write("EventReadConfirmation", "1")
'm_CommComponent.Write("EventReadConfirmation", "1")
m_ComComponent.Write("EventReadConfirmation", "1")
End If
End If
Catch ex As Exception
End Try
End Sub
The "m_ComComponent" generates the following ompile error:
'AdvancedHMIControls.DataSubsriber2.m_ComComponent' is not accessible in this context because it is private