Pokusavam pročitati sa RS232 , signal u ascii codu, postavio sam referencu na System.IO.Ports i to radi samo mi kao vrijednost izbacuje "???????" ne dekodira sinagnal , kod je ovaj, jel netko zna zasto...jeli netko radio ovo??Visual Basic 2005 HVala
Public Class Form1
Private WithEvents objPort As SerialPort
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
objPort = New SerialPort("COM4", 9600)
objPort.ReceivedBytesThreshold = 1024
objPort.Open()
End Sub
Private Sub objPort_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles objPort.DataReceived
Dim strSerialPortData As String = objPort.ReadExisting
End Sub
Private WithEvents ascii As New ASCIIEncoding
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim strSerialPortData As String = objPort.ReadExisting
Dim unicodeString As [String] = strSerialPortData
Dim encodedBytes As [Byte]() = ascii.GetBytes(unicodeString)
textBox1.Text = unicodeString
End Sub