[ slavenp @ 03.12.2002. 13:13 ] @
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
[ mladenovicz @ 11.12.2002. 20:41 ] @
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

[ slavenp @ 12.12.2002. 15:52 ] @
Hvala Uspio sam