AccessTr.neT
com port dan veri alma - Baskı Önizleme

+- AccessTr.neT (https://accesstr.net)
+-- Forum: Microsoft Access (https://accesstr.net/forum-microsoft-access.html)
+--- Forum: Access Cevaplanmış Soruları (https://accesstr.net/forum-access-cevaplanmis-sorulari.html)
+--- Konu Başlığı: com port dan veri alma (/konu-com-port-dan-veri-alma.html)

Sayfalar: 1 2 3


com port dan veri alma - barcins - 29/05/2009

merhaba arkadaşlar Access le kendi işlerimi kolaylaştıram farklı programlar yaptım.

bir sorum olucak araç kantarındaki invikatör com1 portuna takılı
kantar programı buradan kiloyu okuyabiliyor.
biz Access programının içinde okutabilirmiyiz.


Cvp: com port dan veri alma - esrefigit - 29/05/2009

olabilir


Cvp: com port dan veri alma - barcins - 29/05/2009

Img-grin ben tartı programı yapmak istiyorum.


Cvp: com port dan veri alma - esrefigit - 29/05/2009

bunun için mscomm.dll diye bir kiatplık var onu yüklemen lazım
sana örnek bir port okuma yazma kodu


porta bilgi gönderme


Private Sub Command1_Click()
With MSComm1
'make sure the serial port is open
If .PortOpen = False Then .PortOpen = True
'send the data (including a tailing carriage return as often needed)
.Output = Text2.Text & vbCr
End With 'MSComm1
With Text2
'place the focus back to the textbox
.SetFocus
'select the current text to be overwritten
.SelStart = 0
.SelLength = Len(.Text)
End With 'Text1
End Sub

portu açma

Private Sub Form_Load()
With MSComm1
'make sure the serial port is not open (by this program)
If .PortOpen Then .PortOpen = False
'set the active serial port
.CommPort = 2
'set the badurate,parity,databits,stopbits for the connection
.Settings = "9600,N,8,1"
'set the DRT and RTS flags
.DTREnable = True
.RTSEnable = True
'enable the oncomm event for every reveived character
.RThreshold = 1
'disable the oncomm event for send characters
.SThreshold = 0
'open the serial port
.PortOpen = True
End With 'MSComm1

End Sub

porttan gelen bilgiyi okuma


Private Sub MSComm1_OnComm()
Dim strInput As String
With MSComm1
'test for incoming event
Select Case .CommEvent
Case comEvReceive
'display incoming event data to displaying textbox
strInput = .Input
Text1.SelText = strInput
End Select
End With 'MSComm1
End Sub


Cvp: com port dan veri alma - barcins - 29/05/2009

çok teşeekkür ederim denicem. son olarak
bilgiyi bir keremi okuyor sürekli yeniliyormu değişiklikler için.
birde porta bilgi gönderme, port açma, port okuma, üçünü bir kullanmıcam herhalde.
kusura bakmayın kod yazma harici Access de çok şey yapıyorumda kod işi beni aşıyor.


Cvp: com port dan veri alma - barcins - 30/05/2009

çok aradım fakat mscomm.dll yi bulamıyorum Img-cray
tamamam samsung telefon cd sinde buldum dll. yi
2 satırda hata verdi.

Rem porttan gelen bilgiyi okuma

Private Sub Komut0_Click()
Dim strInput As String
With MSComm1
'test for incoming event
Select Case .CommEvent
Case comEvReceive
'display incoming event data to displaying textbox
strInput = .Input
Metin1.SelText = strInput
End Select
End With 'MSComm1

End Sub




Rem portu açma
Private Sub Komut4_Click()
With MSComm1
'make sure the serial port is not open (by this program)
If .PortOpen Then .PortOpen = False
'set the active serial port
.CommPort = 2
'set the badurate,parity,databits,stopbits for the connection
.Settings = "9600,N,8,1"
'set the DRT and RTS flags
.DTREnable = True
.RTSEnable = True
'enable the oncomm event for every reveived character
.RThreshold = 1
'disable the oncomm event for send characters
.SThreshold = 0
'open the serial port
.PortOpen = True
End With 'MSComm1

End Sub


nasıl halledebilirim.
ufak programda yaptım şimdilik yardımlarınız için teşekkür ederim.