Kayıt Tarihi: 26.03.2008
Toplam 223 konu açtı.
Toplam 538 yorum yaptı.
Toplam
39
puanı bulunmakta.
Mevcut Office Sürümü:
Office 2010 TR,
Beğeniler: 0 / 4
elimde rs232 bağlantılı bir terazi var burdan gelen veriyi tabloya , forma veya txt dosyasına nasıl gönderebilirim. bilgisi olan varmı acaba
şimdiden teşekürler...
Kayıt Tarihi: 25.02.2010
Toplam 20 konu açtı.
Toplam 713 yorum yaptı.
Toplam
0
puanı bulunmakta.
Mevcut Office Sürümü:
Office 2010 TR,
Office 2013 TR,
Beğeniler: 0 / 1
Merhaba, ben network özelliği olan bir teraziden bilgi almayı başarmıştım. Ama terazinin örnek kodları vardı. Tavsiyem hyper terminal ile öncelikle terazi çıkış veriyor mu onu kontrol edin.
"Gönül deniz, dil kıyıdır. Denizde ne varsa kıyıya o vurur"
Kayıt Tarihi: 26.03.2008
Toplam 223 konu açtı.
Toplam 538 yorum yaptı.
Toplam
39
puanı bulunmakta.
Mevcut Office Sürümü:
Office 2010 TR,
Beğeniler: 0 / 4
Terazinin kendi programi var onunla denedim sorunsuz calisiyor
Kayıt Tarihi: 25.02.2010
Toplam 20 konu açtı.
Toplam 713 yorum yaptı.
Toplam
0
puanı bulunmakta.
Mevcut Office Sürümü:
Office 2010 TR,
Office 2013 TR,
Beğeniler: 0 / 1
Siz yinede hyper terminal ile com porttan bir deneme yapın. Ve ekrana gelen bilgiyi kontrol edin.
Sonrasında Formun kod sayfasına aşağıdaki kodları ekleyin.
Visual Basic
Private Sub MSComm1_OnComm()
Dim InBuff As String
Select Case MSComm1.CommEvent
' Handle each event or error by placing
' code below each case statement.
' This template is found in the Example
' section of the OnComm event Help topic
' in VB Help.
' Errors
Case comEventBreak ' A Break was received.
Case comEventCDTO ' CD (RLSD) Timeout.
Case comEventCTSTO ' CTS Timeout.
Case comEventDSRTO ' DSR Timeout.
Case comEventFrame ' Framing Error.
Case comEventOverrun ' Data Lost.
Case comEventRxOver ' Receive buffer overflow.
Case comEventRxParity ' Parity Error.
Case comEventTxFull ' Transmit buffer full.
Case comEventDCB ' Unexpected error retrieving DCB]
' Events
Case comEvCD ' Change in the CD line.
Case comEvCTS ' Change in the CTS line.
Case comEvDSR ' Change in the DSR line.
Case comEvRing ' Change in the Ring Indicator.
Case comEvReceive ' Received RThreshold # of chars.
InBuff = MSComm1.Input
Call HandleInput(InBuff)
Case comEvSend ' There are SThreshold number of
' characters in the transmit buffer.
Case comEvEOF ' An EOF character was found in the
' input stream.
End Select
End Sub
Sub HandleInput(InBuff As String)
' This is where you will process your input. This
' includes trapping characters, parsing strings,
' separating data fields, etc. For this case, you
' are simply going to display the data in the TextBox.
On Error GoTo HandleInput_Error
text1.SelStart = Len(text1.text)
text1.SelText = InBuff
On Error GoTo 0
Exit Sub
HandleInput_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure HandleInput of VBA Document Form_Form2"
End Sub
Formun Yüklendiğinde olayına aşağıdaki kodu yazın.
Visual Basic
Private Sub Form_Load()
' Form1.Caption = "App2"
With MSComm1
.CommPort = 2
.Handshaking = 2 - comRTS
.RThreshold = 1
.RTSEnable = True
.Settings = "1200,n,8,1"
.SThreshold = 1
.PortOpen = True
' Leave all other settings as default values.
End With
End Sub
Kaldırıldığında olayına aşağıdaki kodu,
Visual Basic
Private Sub Form_Unload(Cancel As Integer)
On Error GoTo Form_Unload_Error
MSComm1.PortOpen = False
On Error GoTo 0
Exit Sub
Form_Unload_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Form_Unload of VBA Document Form_Form2"
End Sub
Yukarıdaki kod sayesinde tex1 metin kutusuna terazideki değeri vermesi gerekir.Ben sertlik ölçme cihazından bu şekilde bilgi almıştım.
"Gönül deniz, dil kıyıdır. Denizde ne varsa kıyıya o vurur"
Kayıt Tarihi: 25.02.2010
Toplam 20 konu açtı.
Toplam 713 yorum yaptı.
Toplam
0
puanı bulunmakta.
Mevcut Office Sürümü:
Office 2010 TR,
Office 2013 TR,
Beğeniler: 0 / 1
Tabi kodları kullanabilmek için MS Comm active x eklemeniz gerekiyor.
"Gönül deniz, dil kıyıdır. Denizde ne varsa kıyıya o vurur"
Kayıt Tarihi: 26.03.2008
Toplam 223 konu açtı.
Toplam 538 yorum yaptı.
Toplam
39
puanı bulunmakta.
Mevcut Office Sürümü:
Office 2010 TR,
Beğeniler: 0 / 4
SAYIN dreamt ilgin için teşekürler
.CommPort = 0
bu satırda hata veriyor ne yapabilirim acaba...