5
« on: July 29, 2015, 11:15:29 AM »
it's contiuing to log no mater the stat of the bit I added to the Datasubscriber. Just to be sure I'll add what I changed below.
Public Enum TriggerType
TimeInterval
DataChange
WriteOnBitTrue
EverySample
End Enum
Private m_LogTriggerType As TriggerType
Public Property LogTriggerType As TriggerType
Get
Return m_LogTriggerType
End Get
Set(value As TriggerType)
m_LogTriggerType = value
End Set
End Property
Public LogTimer As Timer
Private m_LogInterval As Integer = 1000
Public Property LogInterval As Integer
Get
Return m_LogInterval
End Get
Set(value As Integer)
m_LogInterval = value
End Set
End Property
And this is what I added to the main form
Public Class MainForm
'*******************************************************************************
'* Stop polling when the form is not visible in order to reduce communications
'* Copy this section of code to every new form created
'*******************************************************************************
Dim NotFirstShow As Boolean
Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
'* Do not start comms on first show in case it was set to disable in design mode
If NotFirstShow Then
AdvancedHMIDrivers.Utilities.StopComsOnHidden(components, Me)
Else
NotFirstShow = True
End If
End Sub
Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
BasicDataLogger21.LogTimer.Enabled = e.Values(0)
End Sub
End Class
Keep in mind I could be missing something simple here
Thanks,
RD