Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Mscomm Controla i hvatanje poruka sa serijskog porta?

[es] :: Visual Basic 6 :: Mscomm Controla i hvatanje poruka sa serijskog porta?

[ Pregleda: 4471 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

slavenp
BL

Član broj: 6316
Poruke: 40
*.wireless.blic.net



Profil

icon Mscomm Controla i hvatanje poruka sa serijskog porta?03.12.2002. u 13:13 - pre 260 meseci
Nekada sam cini mi se koristo commrecieved dogadjaj u svome kodu ali sada se ne mogu sjetiti kako se to radi.
NAime treba da hvatam podatke na serijskom portu od mikrokontrolera ali ne znam kako da to uradim.Posaljem ja to i to radi bez problema od racunara do krajnjeg uredjaja .
I jos nesto kako da se moj program uvice u system tray .
Pozdrav
 
Odgovor na temu

mladenovicz
Zeljko Mladenovic
Xoran Technologies, Inc., Ann Arbor, MI,
USA / Software Engineer
Ann Arbor, MI, USA

Član broj: 6598
Poruke: 2065
*.yubc.net

Jabber: mladenovicz@elitesecurity.org
ICQ: 95144142
Sajt: yubc.net/~mz


Profil

icon Re: Mscomm Controla i hvatanje poruka sa serijskog porta?11.12.2002. u 20:41 - pre 260 meseci
MS Comm dize OnComm event. Property kontrole CommEvent sadrzi informaciju koji je tip eventa u pitanju (comEvReceive kad nesto stigne na port). To nesto sto je stiglo nalazi se u Input propertyu.

Private WithEvents m_Port As MSComm


Private Sub m_Port_OnComm()
Dim msg As String
Dim str As String

str = m_Port.Input
Select Case m_Port.CommEvent
' Errors
Case comEventBreak ' A Break was received.
msg = "ERR event Break"
Case comEventFrame ' Framing Error
msg = "ERR event Frame"
Case comEventOverrun ' Data Lost.
msg = "ERR event Overrun (data lost)"
Case comEventRxOver ' Receive buffer overflow.
msg = "ERR event RxOver (receive buffer overflow)"
Case comEventRxParity ' Parity Error.
msg = "ERR event RxParity (parity error)"
Case comEventTxFull ' Transmit buffer full.
msg = "ERR event TxFull (transmit buffer full)"
Case comEventDCB ' Unexpected error retrieving DCB
msg = "ERR event DCB (unexpected error retrieving DCB)"

'Events
Case comEvCD ' Change in the CD line.
msg = "CD changed (BL " & IIf(m_Port.CDHolding, "True", "False") & ")"
Case comEvCTS ' Change in the CTS line.
msg = "CTS changed (BW " & IIf(m_Port.CTSHolding, "True", "False") & ")"
Case comEvDSR ' Change in the DSR line.
msg = "DSR changed"
Case comEvRing ' Change in the Ring Indicator.
msg = "Ring"
Case comEvReceive ' Received RThreshold # of chars.
msg = "Receive event (Received RThreshold # of chars)"
m_InputStr = m_InputStr & str
m_Events.RaiseCustomEvent Me, "DataReceived", m_InputStr
Debug.Print "m_InputStr", m_InputStr
Case comEvSend ' There are SThreshold number of characters in the transmit buffer.
msg = "Send event"
Case comEvEOF ' An EOF charater was found in the input stream
msg = "EOF found"

Case Else
msg = m_Port.CommEvent
End Select




If m_Port.CommEvent = comEvReceive Then
' neki kod
End If
End Sub


 
Odgovor na temu

slavenp
BL

Član broj: 6316
Poruke: 40
81.93.67.*



Profil

icon Re: Mscomm Controla i hvatanje poruka sa serijskog porta?12.12.2002. u 15:52 - pre 260 meseci
Hvala Uspio sam
 
Odgovor na temu

[es] :: Visual Basic 6 :: Mscomm Controla i hvatanje poruka sa serijskog porta?

[ Pregleda: 4471 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.