By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,775 Members | 1,432 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,775 IT Pros & Developers. It's quick & easy.

Help Parsing data based on received data from Com Port

P: 2
Hi Everyone,

I am a bit new to VB, learning a bunch. However I am having some problems figuring out how to retrieve the data and associate the data to form controls.

Ok here goes.

The device that is sending the data is a Ham Radio and sends data that looks like this.

RM0099;RM0122;RM0087;SM0210;RM0021;SQ1120;RM0120;S M0210;RM0021;SQ1120;RM0120;M0087;SM0210;RM0021;SQ1 120M0087;SM0210;RM0099;RM0122;RM0087;SM0210;RM0021 ;SQ1120;RM0120;SM0210;RM0021;SQ1120;RM0120;M0087;S M0210;RM0021;SQ1120M0087;SM0210;

For Example the "RM0099" is a reference , the "RM" indicates the Function of the radio, "RM" in this case means Radio Meter, the "SM" Signal Meter, the "SQ" Squelch. The Numbers indicate the reference level. This is a continuous data stream and I am trying to look at each setting by the "RM","SM","SQ" and their associate level which I use to update things like progress bar, etc. There are about 150 or so different References as Letters and the values range from numeric levels of 2 to 15. Each Reference is separated by a ; so extracting does not seem to complicated, however I am having some issues figuring the best way to accomplish this. I was using a timer to read the data then trim, or extract the data but easier said than done. Can anyone give me a bit of advice on this. Thanks.
Mar 26 '16 #1
Share this Question
Share on Google+
1 Reply

P: 2
Expand|Select|Wrap|Line Numbers
  1. Private Sub ReceivedText(ByVal [text] As String)
  2.         'compares the ID of the creating Thread to the ID of the calling Thread
  3.         If Me.rxTextBox.InvokeRequired Then
  4.             Dim x As New SetTextCallback(AddressOf ReceivedText)
  5.             Me.Invoke(x, New Object() {(text)})
  6.         Else
  7.             Dim rssiString As String = [text]
  8.             rssiString = rssiString.Substring(3, 3)
  9.             Label5.Text = rssiString
  10.         End If
  12.     End Sub
Mar 26 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.