Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mboisse@acp99.com

Pages: [1]
1
Support Questions / Re: Timer reset
« on: August 15, 2018, 08:16:57 AM »
OK

The DataSubscriber1.Value <=10 is to check the speed of one machine , if the speed is lower then 10  the TempMinutes start to count ( seconde ) when it arrived at 60 the variable HeureMinutes got + 1 and TempMinutes must reset to 0 and we got the same process for hrs and day , the ress of it is for 3 machine


TY for your help

2
Support Questions / Timer reset
« on: August 14, 2018, 11:16:55 AM »

I would like to now if it possible to reset a timer to 0 when I arrived at a certain number let say that timer2 is set to timer2 = 60
 then heureminutes = heeminute + 1 and the timer2 reset to 0 to made a another cylce




ublic 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 TempMinutes As Integer = 0
    Dim HeureMinutes As Integer = 0
    Dim jourMinutes As Integer = 0
    Dim seconderh As Integer = 0
    Dim minutesrh As Integer = 0
    Dim heuresrh As Integer = 0
    Dim joursrh As Integer = 0
    Dim minjag As Integer = 0
    Dim secjag As Integer = 0
    Dim hrjag As Integer = 0
    Dim jourjag As Integer = 0
    Private 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

    '***************************************************************
    '* .NET does not close hidden forms, so do it here
    '* to make sure forms are disposed and drivers close
    '***************************************************************
    Private Sub MainForm_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        Dim index As Integer
        While index < My.Application.OpenForms.Count
            If My.Application.OpenForms(index) IsNot Me Then
                My.Application.OpenForms(index).Close()
            End If
            index += 1
        End While
    End Sub
    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles TimerPoly1M.Tick
        If DataSubscriber1.Value <= 10 Then
            TempMinutes = TempMinutes + 1   '* compteur de seconde quand la 18 est arreter
            Label3.Text = TempMinutes        '* compteur de seconde quand la 18 est arreter
        End If
    End Sub

    Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles TimerPoly2H.Tick
        If TempMinutes = 60 Then
            HeureMinutes = HeureMinutes + 1 '* Poly 18
            Label4.Text = HeureMinutes
        End If
    End Sub
    Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timerpoly3J.Tick
        If HeureMinutes = 24 Then
            jourMinutes = jourMinutes + 1 '* Poly 18
            Label5.Text = jourMinutes
        End If
    End Sub

    Private Sub secondesrh_Tick(sender As Object, e As EventArgs) Handles secondesrh.Tick
        If DataSubscriber2.Value <= 0 Then
            seconderh = seconderh + 1
            Label10.Text = seconderh

        End If
    End Sub

Pages: [1]