This is a Windows7 project.
You is need to use parallel port the IO.DLL file for windows!
You must download IO.DLL file and copy it in C:\WINDOWS\system32
More info:
http://www.geekhideout.com/iodll.shtml
Visual Basic code:
Module Module1
Public Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Public Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Public Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Public Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Public Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Public Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Public Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function IsDriverInstalled Lib "IO.DLL" () As Boolean
Sub Delay(ByVal dblsecs As Double)
Const onesec As Double = 1.0# / (1440.0# * 60.0#)
Dim dblWaitTil As Date
Now.AddSeconds(onesec)
dblWaitTil = Now.AddSeconds(onesec).AddSeconds(dblsecs)
Do Until Now > dblWaitTil
Application.DoEvents()
Loop
End Sub
End Module
-----------------------------
Public Class Form1
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim beginning As Integer = 0
Dim visitor As Integer = 0
Dim counter As Integer = 0
line1:
Dim situation As Integer = PortIn(889)
If situation <> beginning Then
If situation = 191 Then
counter = counter * 0
End If
If situation = 255 Then
counter = counter + 1
End If
If situation = 63 Then
counter = counter - 1
End If
If situation = 127 Then
counter = counter * 5
End If
If counter = 4 Then
visitor = visitor + 1
End If
If counter = -4 Then
visitor = visitor - 1
End If
End If
beginning = situation
Label1.Text = visitor
Delay(0.01)
GoTo line1
End Sub
End Class
---------------------------------------------------------------------------------------
Other version:
Module Module1
Public Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Public Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Public Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Public Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Public Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Public Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Public Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function IsDriverInstalled Lib "IO.DLL" () As Boolean
End Module
----------------------------------------------------------------------------------------
Public Class Form1
Dim beginning As Integer = 0
Dim visitor As Integer = 0
Dim counter As Integer = 0
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim situation As Integer = PortIn(889)
If situation <> beginning Then
If situation = 127 Then
counter = counter + 1
End If
If situation = 255 And counter = 1 Then
visitor = visitor + 1
End If
If situation = 63 And counter = 1 Then
visitor = visitor - 1
End If
If situation = 191 Then
counter = 0
End If
End If
Label2.Text = situation
Label1.Text = visitor
beginning = situation
End Sub
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
End Sub
End Class
-----------------------------------------------------------------------------
Blue print:
You must use strong IR radiant...
See more:
https://docs.microsoft.com/en-us/dotnet/articles/visual-basic/index
The End
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
Program további fejlesztése, a munkahelyemre, magamnak:
A 16 variáció:
13,12,11,10 pins (parallel status) x = LOW = contact o = HIGH = break
x x x x 143
o o o o 127
o o o x 63
o o x o 255
o x o o 95
x o o o 111
o o x x 191
x x o o 79
o x o x 31
x o x o 239
x o o x 47
o x x o 223
x x x o 207
o x x x 159
x o x x 175
x x o x 15
Ez még nem jó. Ezeket kell még bele:
-Előző naplózás törlése.
-Végén összesítő naplózás
-LED adó-vevő fizikai kiépítés
--------------------------------------------------------------------------------------
Imports System
Imports System.IO
Imports System.Text
Module Module1
Public Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Public Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Public Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Public Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Public Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Public Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Public Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Public Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Public Declare Function IsDriverInstalled Lib "IO.DLL" () As Boolean
Sub Delay(ByVal dblsecs As Double)
Const onesec As Double = 1.0# / (1440.0# * 60.0#)
Dim dblWaitTil As Date
Now.AddSeconds(onesec)
dblWaitTil = Now.AddSeconds(onesec).AddSeconds(dblsecs)
Do Until Now > dblWaitTil
Application.DoEvents()
Loop
End Sub
Sub Main()
Dim path As String = "c:\naplo\kollegista.txt" And "c:\naplo\kulsos.txt"
Dim fs As FileStream = File.Create(path)
End Sub
End Module
------------------------------------------------------------------
------------------------------------------------------------------
Public Class Form1
Dim kulsorend As Integer
Dim leall As Integer = 0
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim kulsosrendezok As Decimal = NumericUpDown1.Value
Dim biztonsagiak As Decimal = NumericUpDown3.Value
Dim visitor As Integer = kulsosrendezok + biztonsagiak
Dim kulrend As String = CStr(kulsosrendezok)
Dim biztik As String = CStr(biztonsagiak)
Dim inputString As String = "RENDEZVÉNY (hónap/nap/év=) " + DateString + " KÜLSŐS LÉTSZÁMOK: RENDEZŐK: " + kulrend + " FŐ + BIZTONSÁGI ŐRÖK: " + biztik + "FŐ, START: " + TimeString + " "
Dim beginning As Integer = 0
Dim beginning2 As Integer = 0
Dim beginning3 As Integer = 0
Dim beginning4 As Integer = 0
Dim beginning5 As Integer = 0
Dim beginning6 As Integer = 0
Dim beginning7 As Integer = 0
Dim counter As Integer = 0
Dim sorozat As Integer = 0
Dim koliskorlat As Integer = NumericUpDown4.Value
If leall = 0 Then
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", inputString, True)
End If
Dim kolisrendezok As Decimal = NumericUpDown2.Value
Dim visitorb As Integer = kolisrendezok
Dim kolirend As String = CStr(kolisrendezok)
Dim inputStringb As String = " RENDEZVÉNY (hónap/nap/év=) " + DateString + " KOLLÉGISTA LÉTSZÁMOK: RENDEZŐK: " + kolirend + " FŐ, START: " + TimeString + " "
Dim beginningb As Integer = 0
Dim counterb As Integer = 0
Dim kulsoskorlat As Integer = NumericUpDown5.Value
If leall = 0 Then
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", inputStringb, True)
End If
leall = leall + 1
Me.Button1.Text = "STOP"
Dim bit1 As Integer = 0
Dim bit2 As Integer = 0
Dim bit3 As Integer = 0
Dim bit4 As Integer = 0
line1:
Dim situation As Integer = PortIn(889)
If situation = 143 Then
bit1 = 0
bit2 = 0
bit3 = 0
bit4 = 0
End If
If situation = 127 Then
bit1 = 1
bit2 = 1
bit3 = 1
bit4 = 1
End If
If situation = 63 Then
bit1 = 0
bit2 = 1
bit3 = 1
bit4 = 1
End If
If situation = 255 Then
bit1 = 1
bit2 = 0
bit3 = 1
bit4 = 1
End If
If situation = 95 Then
bit1 = 1
bit2 = 1
bit3 = 0
bit4 = 1
End If
If situation = 111 Then
bit1 = 1
bit2 = 1
bit3 = 1
bit4 = 0
End If
If situation = 191 Then
bit1 = 0
bit2 = 0
bit3 = 1
bit4 = 1
End If
If situation = 79 Then
bit1 = 1
bit2 = 1
bit3 = 0
bit4 = 0
End If
If situation = 31 Then
bit1 = 0
bit2 = 1
bit3 = 0
bit4 = 1
End If
If situation = 239 Then
bit1 = 1
bit2 = 0
bit3 = 1
bit4 = 0
End If
If situation = 47 Then
bit1 = 0
bit2 = 1
bit3 = 1
bit4 = 0
End If
If situation = 223 Then
bit1 = 1
bit2 = 0
bit3 = 0
bit4 = 1
End If
If situation = 207 Then
bit1 = 1
bit2 = 0
bit3 = 0
bit4 = 0
End If
If situation = 159 Then
bit1 = 0
bit2 = 0
bit3 = 0
bit4 = 1
End If
If situation = 175 Then
bit1 = 0
bit2 = 0
bit3 = 1
bit4 = 0
End If
If situation = 15 Then
bit1 = 0
bit2 = 1
bit3 = 0
bit4 = 0
End If
If bit1 <> beginning Or bit2 <> beginning2 Then
If bit1 = 0 And bit2 = 0 Then
counter = counter * 0
End If
If bit1 = 1 And bit2 = 0 Then
counter = counter + 1
End If
If bit1 = 0 And bit2 = 1 Then
counter = counter - 1
End If
If bit1 = 1 And bit2 = 1 Then
counter = counter * 5
End If
If counter = 4 Then
visitor = visitor + 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", "Be,", True)
End If
If counter = -4 Then
visitor = visitor - 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", "Ki,", True)
End If
End If
If bit3 <> beginning3 Or bit4 <> beginning4 Then
If bit3 = 0 And bit4 = 0 Then
counterb = counterb * 0
End If
If bit3 = 1 And bit4 = 0 Then
counterb = counterb + 1
End If
If bit3 = 0 And bit4 = 1 Then
counterb = counterb - 1
End If
If bit3 = 1 And bit4 = 1 Then
counterb = counterb * 5
End If
If counterb = 4 Then
visitorb = visitorb + 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", "Be,", True)
End If
If counterb = -4 Then
visitorb = visitorb - 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", "Ki,", True)
End If
End If
If visitor > kulsoskorlat - 15 Then
Label4.BackColor = Color.DarkRed
Else
Label4.BackColor = Color.CornflowerBlue
End If
If visitorb > koliskorlat - 15 Then
Label3.BackColor = Color.DarkRed
Else
Label3.BackColor = Color.CornflowerBlue
End If
beginning = bit1
beginning2 = bit2
beginning3 = bit3
beginning4 = bit4
Label1.Text = visitor
Label5.Text = visitorb
Label7.Text = visitor + visitorb
Label27.Text = situation
sorozat = sorozat + 1
If sorozat = 3000 Then
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", " A LÉTSZÁM " + TimeString + "-KOR " + CStr(visitor) + " FŐ ", True)
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", " A LÉTSZÁM " + TimeString + "-KOR " + CStr(visitorb) + " FŐ ", True)
If visitor > 0 Then
Label19.Text = CStr(visitor) + " Fő " + TimeString
End If
If visitorb > 0 Then
Label18.Text = CStr(visitorb) + " Fő " + TimeString
End If
If visitor + visitorb > 0 Then
Label20.Text = CStr(visitor + visitorb) + " Fő " + TimeString
End If
sorozat = 0
End If
beginning5 = visitor
beginning6 = visitorb
beginning7 = visitor + visitorb
If leall = 1 Then
Delay(0.01)
GoTo line1
End If
Button1.Visible = False
Label12.Text = " Fájlok a c:/naplo/ mappában!"
End Sub
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
End Sub
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
End Sub
Private Sub Label5_Click(sender As Object, e As EventArgs) Handles Label5.Click
End Sub
Private Sub Label7_Click(sender As Object, e As EventArgs) Handles Label7.Click
End Sub
Private Sub Label8_Click(sender As Object, e As EventArgs) Handles Label8.Click
End Sub
Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
End Sub
Private Sub Label10_Click(sender As Object, e As EventArgs) Handles Label10.Click
End Sub
Private Sub Label12_Click(sender As Object, e As EventArgs) Handles Label12.Click
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", "Ki,", True)
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", "Be,", True)
Delay(1)
My.Computer.FileSystem.DeleteFile("c:\naplo\kulsos.txt")
My.Computer.FileSystem.DeleteFile("c:\naplo\kollegista.txt")
Label6.Text = NumericUpDown2.Value
Label14.Text = NumericUpDown1.Value
Label15.Text = NumericUpDown3.Value
Label16.Text = NumericUpDown5.Value
Label17.Text = NumericUpDown4.Value
Label5.Text = NumericUpDown2.Value
Label1.Text = NumericUpDown1.Value + NumericUpDown3.Value
Label7.Text = NumericUpDown1.Value + NumericUpDown2.Value + NumericUpDown3.Value
Label14.Visible = True
Label6.Visible = True
Label15.Visible = True
Label16.Visible = True
Label17.Visible = True
NumericUpDown1.Visible = False
NumericUpDown2.Visible = False
NumericUpDown3.Visible = False
NumericUpDown4.Visible = False
NumericUpDown5.Visible = False
Label12.Text = " Adatok:"
Button2.Visible = False
Button1.Visible = True
End Sub
End Class
------------------------------------------------------------------
Public Class Form1
Dim kulsorend As Integer
Dim leall As Integer = 0
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim kulsosrendezok As Decimal = NumericUpDown1.Value
Dim biztonsagiak As Decimal = NumericUpDown3.Value
Dim visitor As Integer = kulsosrendezok + biztonsagiak
Dim kulrend As String = CStr(kulsosrendezok)
Dim biztik As String = CStr(biztonsagiak)
Dim inputString As String = "RENDEZVÉNY (hónap/nap/év=) " + DateString + " KÜLSŐS LÉTSZÁMOK: RENDEZŐK: " + kulrend + " FŐ + BIZTONSÁGI ŐRÖK: " + biztik + "FŐ, START: " + TimeString + " "
Dim beginning As Integer = 0
Dim beginning2 As Integer = 0
Dim beginning3 As Integer = 0
Dim beginning4 As Integer = 0
Dim beginning5 As Integer = 0
Dim beginning6 As Integer = 0
Dim beginning7 As Integer = 0
Dim counter As Integer = 0
Dim sorozat As Integer = 0
Dim koliskorlat As Integer = NumericUpDown4.Value
If leall = 0 Then
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", inputString, True)
End If
Dim kolisrendezok As Decimal = NumericUpDown2.Value
Dim visitorb As Integer = kolisrendezok
Dim kolirend As String = CStr(kolisrendezok)
Dim inputStringb As String = " RENDEZVÉNY (hónap/nap/év=) " + DateString + " KOLLÉGISTA LÉTSZÁMOK: RENDEZŐK: " + kolirend + " FŐ, START: " + TimeString + " "
Dim beginningb As Integer = 0
Dim counterb As Integer = 0
Dim kulsoskorlat As Integer = NumericUpDown5.Value
If leall = 0 Then
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", inputStringb, True)
End If
leall = leall + 1
Me.Button1.Text = "STOP"
Dim bit1 As Integer = 0
Dim bit2 As Integer = 0
Dim bit3 As Integer = 0
Dim bit4 As Integer = 0
line1:
Dim situation As Integer = PortIn(889)
If situation = 143 Then
bit1 = 0
bit2 = 0
bit3 = 0
bit4 = 0
End If
If situation = 127 Then
bit1 = 1
bit2 = 1
bit3 = 1
bit4 = 1
End If
If situation = 63 Then
bit1 = 0
bit2 = 1
bit3 = 1
bit4 = 1
End If
If situation = 255 Then
bit1 = 1
bit2 = 0
bit3 = 1
bit4 = 1
End If
If situation = 95 Then
bit1 = 1
bit2 = 1
bit3 = 0
bit4 = 1
End If
If situation = 111 Then
bit1 = 1
bit2 = 1
bit3 = 1
bit4 = 0
End If
If situation = 191 Then
bit1 = 0
bit2 = 0
bit3 = 1
bit4 = 1
End If
If situation = 79 Then
bit1 = 1
bit2 = 1
bit3 = 0
bit4 = 0
End If
If situation = 31 Then
bit1 = 0
bit2 = 1
bit3 = 0
bit4 = 1
End If
If situation = 239 Then
bit1 = 1
bit2 = 0
bit3 = 1
bit4 = 0
End If
If situation = 47 Then
bit1 = 0
bit2 = 1
bit3 = 1
bit4 = 0
End If
If situation = 223 Then
bit1 = 1
bit2 = 0
bit3 = 0
bit4 = 1
End If
If situation = 207 Then
bit1 = 1
bit2 = 0
bit3 = 0
bit4 = 0
End If
If situation = 159 Then
bit1 = 0
bit2 = 0
bit3 = 0
bit4 = 1
End If
If situation = 175 Then
bit1 = 0
bit2 = 0
bit3 = 1
bit4 = 0
End If
If situation = 15 Then
bit1 = 0
bit2 = 1
bit3 = 0
bit4 = 0
End If
If bit1 <> beginning Or bit2 <> beginning2 Then
If bit1 = 0 And bit2 = 0 Then
counter = counter * 0
End If
If bit1 = 1 And bit2 = 0 Then
counter = counter + 1
End If
If bit1 = 0 And bit2 = 1 Then
counter = counter - 1
End If
If bit1 = 1 And bit2 = 1 Then
counter = counter * 5
End If
If counter = 4 Then
visitor = visitor + 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", "Be,", True)
End If
If counter = -4 Then
visitor = visitor - 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", "Ki,", True)
End If
End If
If bit3 <> beginning3 Or bit4 <> beginning4 Then
If bit3 = 0 And bit4 = 0 Then
counterb = counterb * 0
End If
If bit3 = 1 And bit4 = 0 Then
counterb = counterb + 1
End If
If bit3 = 0 And bit4 = 1 Then
counterb = counterb - 1
End If
If bit3 = 1 And bit4 = 1 Then
counterb = counterb * 5
End If
If counterb = 4 Then
visitorb = visitorb + 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", "Be,", True)
End If
If counterb = -4 Then
visitorb = visitorb - 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", "Ki,", True)
End If
End If
If visitor > kulsoskorlat - 15 Then
Label4.BackColor = Color.DarkRed
Else
Label4.BackColor = Color.CornflowerBlue
End If
If visitorb > koliskorlat - 15 Then
Label3.BackColor = Color.DarkRed
Else
Label3.BackColor = Color.CornflowerBlue
End If
beginning = bit1
beginning2 = bit2
beginning3 = bit3
beginning4 = bit4
Label1.Text = visitor
Label5.Text = visitorb
Label7.Text = visitor + visitorb
Label27.Text = situation
sorozat = sorozat + 1
If sorozat = 3000 Then
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", " A LÉTSZÁM " + TimeString + "-KOR " + CStr(visitor) + " FŐ ", True)
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", " A LÉTSZÁM " + TimeString + "-KOR " + CStr(visitorb) + " FŐ ", True)
If visitor > 0 Then
Label19.Text = CStr(visitor) + " Fő " + TimeString
End If
If visitorb > 0 Then
Label18.Text = CStr(visitorb) + " Fő " + TimeString
End If
If visitor + visitorb > 0 Then
Label20.Text = CStr(visitor + visitorb) + " Fő " + TimeString
End If
sorozat = 0
End If
beginning5 = visitor
beginning6 = visitorb
beginning7 = visitor + visitorb
If leall = 1 Then
Delay(0.01)
GoTo line1
End If
Button1.Visible = False
Label12.Text = " Fájlok a c:/naplo/ mappában!"
End Sub
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
End Sub
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
End Sub
Private Sub Label5_Click(sender As Object, e As EventArgs) Handles Label5.Click
End Sub
Private Sub Label7_Click(sender As Object, e As EventArgs) Handles Label7.Click
End Sub
Private Sub Label8_Click(sender As Object, e As EventArgs) Handles Label8.Click
End Sub
Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
End Sub
Private Sub Label10_Click(sender As Object, e As EventArgs) Handles Label10.Click
End Sub
Private Sub Label12_Click(sender As Object, e As EventArgs) Handles Label12.Click
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", "Ki,", True)
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", "Be,", True)
Delay(1)
My.Computer.FileSystem.DeleteFile("c:\naplo\kulsos.txt")
My.Computer.FileSystem.DeleteFile("c:\naplo\kollegista.txt")
Label6.Text = NumericUpDown2.Value
Label14.Text = NumericUpDown1.Value
Label15.Text = NumericUpDown3.Value
Label16.Text = NumericUpDown5.Value
Label17.Text = NumericUpDown4.Value
Label5.Text = NumericUpDown2.Value
Label1.Text = NumericUpDown1.Value + NumericUpDown3.Value
Label7.Text = NumericUpDown1.Value + NumericUpDown2.Value + NumericUpDown3.Value
Label14.Visible = True
Label6.Visible = True
Label15.Visible = True
Label16.Visible = True
Label17.Visible = True
NumericUpDown1.Visible = False
NumericUpDown2.Visible = False
NumericUpDown3.Visible = False
NumericUpDown4.Visible = False
NumericUpDown5.Visible = False
Label12.Text = " Adatok:"
Button2.Visible = False
Button1.Visible = True
End Sub
End Class
-----------------------------------------------------
-----------------------------------------------------
Máshogyan naplózás nélkül:
Public Class Form1
Dim kulsorend As Integer
Dim leall As Integer = 0
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim kulsosrendezok As Decimal = NumericUpDown1.Value
Dim biztonsagiak As Decimal = NumericUpDown3.Value
Dim visitor As Integer = kulsosrendezok + biztonsagiak
Dim kulrend As String = CStr(kulsosrendezok)
Dim biztik As String = CStr(biztonsagiak)
Dim inputString As String = "RENDEZVÉNY (hónap/nap/év=) " + DateString + " KÜLSŐS LÉTSZÁMOK: RENDEZŐK: " + kulrend + " FŐ + BIZTONSÁGI ŐRÖK: " + biztik + "FŐ, START: " + TimeString + " "
Dim beginning As Integer = 0
Dim beginning2 As Integer = 0
Dim beginning3 As Integer = 0
Dim beginning4 As Integer = 0
Dim beginning5 As Integer = 0
Dim beginning6 As Integer = 0
Dim counter As Integer = 0
Dim koliskorlat As Integer = NumericUpDown4.Value
Dim kolisrendezok As Decimal = NumericUpDown2.Value
Dim visitorb As Integer = kolisrendezok
Dim kolirend As String = CStr(kolisrendezok)
Dim inputStringb As String = " RENDEZVÉNY (hónap/nap/év=) " + DateString + " KOLLÉGISTA LÉTSZÁMOK: RENDEZŐK: " + kolirend + " FŐ, START: " + TimeString + " "
Dim beginningb As Integer = 0
Dim counterb As Integer = 0
Dim kulsoskorlat As Integer = NumericUpDown5.Value
leall = leall + 1
Me.Button1.Text = "STOP"
Dim bit1 As Integer = 0
Dim bit2 As Integer = 0
Dim bit3 As Integer = 0
Dim bit4 As Integer = 0
If leall = 1 Then
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", inputString, True)
End If
If leall = 1 Then
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", inputStringb, True)
End If
line1:
Dim situation As Integer = PortIn(889)
If situation = 143 Then
bit1 = 0
bit2 = 0
bit3 = 0
bit4 = 0
End If
If situation = 127 Then
bit1 = 1
bit2 = 1
bit3 = 1
bit4 = 1
End If
If situation = 63 Then
bit1 = 0
bit2 = 1
bit3 = 1
bit4 = 1
End If
If situation = 255 Then
bit1 = 1
bit2 = 0
bit3 = 1
bit4 = 1
End If
If situation = 95 Then
bit1 = 1
bit2 = 1
bit3 = 0
bit4 = 1
End If
If situation = 111 Then
bit1 = 1
bit2 = 1
bit3 = 1
bit4 = 0
End If
If situation = 191 Then
bit1 = 0
bit2 = 0
bit3 = 1
bit4 = 1
End If
If situation = 79 Then
bit1 = 1
bit2 = 1
bit3 = 0
bit4 = 0
End If
If situation = 31 Then
bit1 = 0
bit2 = 1
bit3 = 0
bit4 = 1
End If
If situation = 239 Then
bit1 = 1
bit2 = 0
bit3 = 1
bit4 = 0
End If
If situation = 47 Then
bit1 = 0
bit2 = 1
bit3 = 1
bit4 = 0
End If
If situation = 223 Then
bit1 = 1
bit2 = 0
bit3 = 0
bit4 = 1
End If
If situation = 207 Then
bit1 = 1
bit2 = 0
bit3 = 0
bit4 = 0
End If
If situation = 159 Then
bit1 = 0
bit2 = 0
bit3 = 0
bit4 = 1
End If
If situation = 175 Then
bit1 = 0
bit2 = 0
bit3 = 1
bit4 = 0
End If
If situation = 15 Then
bit1 = 0
bit2 = 1
bit3 = 0
bit4 = 0
End If
If bit1 <> beginning Or bit2 <> beginning2 Then
If bit1 = 1 And bit2 = 1 Then
counter = 1
End If
If bit1 = 1 And bit2 = 0 And counter = 1 Then
visitor = visitor + 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", "Be,", True)
End If
If bit1 = 0 And bit2 = 1 And counter = 1 Then
visitor = visitor - 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", "Ki,", True)
End If
If bit1 = 0 And bit2 = 0 Then
counter = 0
End If
End If
If bit3 <> beginning3 Or bit4 <> beginning4 Then
If bit3 = 1 And bit4 = 1 Then
counterb = 1
End If
If bit3 = 1 And bit4 = 0 And counterb = 1 Then
visitorb = visitorb + 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", "Be,", True)
End If
If bit3 = 0 And bit4 = 1 And counterb = 1 Then
visitorb = visitorb - 1
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", "Ki,", True)
End If
If bit3 = 0 And bit4 = 0 Then
counterb = 0
End If
End If
beginning = bit1
beginning2 = bit2
beginning3 = bit3
beginning4 = bit4
Label1.Text = visitor
Label5.Text = visitorb
Label7.Text = visitor + visitorb
Label27.Text = situation
beginning5 = visitor
beginning6 = visitorb
If visitor > kulsoskorlat - 15 Then
Label1.BackColor = Color.DarkRed
Else
Label1.BackColor = Color.CornflowerBlue
End If
If visitorb > koliskorlat - 15 Then
Label5.BackColor = Color.DarkRed
Else
Label5.BackColor = Color.CornflowerBlue
End If
If leall = 1 Then
Delay(0.01)
GoTo line1
End If
Button1.Visible = False
Label12.Text = " Fájlok a c:/naplo/ mappában!"
End Sub
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
End Sub
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
End Sub
Private Sub Label5_Click(sender As Object, e As EventArgs) Handles Label5.Click
End Sub
Private Sub Label7_Click(sender As Object, e As EventArgs) Handles Label7.Click
End Sub
Private Sub Label8_Click(sender As Object, e As EventArgs) Handles Label8.Click
End Sub
Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
End Sub
Private Sub Label10_Click(sender As Object, e As EventArgs) Handles Label10.Click
End Sub
Private Sub Label12_Click(sender As Object, e As EventArgs) Handles Label12.Click
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
My.Computer.FileSystem.WriteAllText("c:\naplo\kollegista.txt", "Ki,", True)
My.Computer.FileSystem.WriteAllText("c:\naplo\kulsos.txt", "Be,", True)
Delay(1)
My.Computer.FileSystem.DeleteFile("c:\naplo\kulsos.txt")
My.Computer.FileSystem.DeleteFile("c:\naplo\kollegista.txt")
Label6.Text = NumericUpDown2.Value
Label14.Text = NumericUpDown1.Value
Label15.Text = NumericUpDown3.Value
Label16.Text = NumericUpDown5.Value
Label17.Text = NumericUpDown4.Value
Label5.Text = NumericUpDown2.Value
Label1.Text = NumericUpDown1.Value + NumericUpDown3.Value
Label7.Text = NumericUpDown1.Value + NumericUpDown2.Value + NumericUpDown3.Value
Label14.Visible = True
Label6.Visible = True
Label15.Visible = True
Label16.Visible = True
Label17.Visible = True
NumericUpDown1.Visible = False
NumericUpDown2.Visible = False
NumericUpDown3.Visible = False
NumericUpDown4.Visible = False
NumericUpDown5.Visible = False
Label12.Text = " Adatok:"
Button2.Visible = False
Button1.Visible = True
End Sub
Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
End Sub
End Class
-------------------------------
-----------------------------