Calling All Programmers - Pro-2052 VB Help

Status
Not open for further replies.

jbitzer

Member
Joined
Feb 17, 2006
Messages
23
Reaction score
0
Location
Cherry Hill,NJ
Well after looking at what seems like a dozen different software packages for my scanner (Radio Shack Pro-2052) I can't fit anything that is a good fit for what I want to do. Sure there are some really great software packages for memory management however as far as monitoring goes; I want something with a better look and feel.

This is where the help is needed. I have dabbled with Visual Basic in the past and as far as being an expert programmer you can just get that thought out of your mind. I know some basic functionality but as far as I/O with a serial port goes I'm coming up blank.

Here's what I want to do:

I want to have a screen that basically resembles the face of the Pro-2052. I will have same buttons and an LCD (a little larger than the one on the unit). Can someone give me some guidance as to how to send commands (such as keypad) to the scanner and on the flip side how to read information coming from the scanner and display it on the LCD panel in my program?

I have found some good references such as http://www.wa8pyr.net/docs/bc245.pdf. What I need to know is how to decode this. I chunk of VB code for sending and receiving info to the scanner would be a great help!!!

I'm just looking for computer control right now. Once I get this stable I will probably add memory management down the road.

Anyone willing to share VB source code would be greatly appreciated.
 

Al42

Member
Joined
Apr 29, 2005
Messages
3,457
Reaction score
0
Location
Long Island, NY, USA
jbitzer said:
This is where the help is needed. I have dabbled with Visual Basic in the past and as far as being an expert programmer you can just get that thought out of your mind. I know some basic functionality but as far as I/O with a serial port goes I'm coming up blank.

Here's what I want to do:

I want to have a screen that basically resembles the face of the Pro-2052. I will have same buttons and an LCD (a little larger than the one on the unit). Can someone give me some guidance as to how to send commands (such as keypad) to the scanner and on the flip side how to read information coming from the scanner and display it on the LCD panel in my program?
Look at the MSComm control. The info in the help files (look at the interrupt-driven input - you don't want to poll the buffer) should get you started.

I have found some good references such as http://www.wa8pyr.net/docs/bc245.pdf. What I need to know is how to decode this. I chunk of VB code for sending and receiving info to the scanner would be a great help!!!
Uniden publishes their protocols, GRE doesn't. (Or is the 2052 a Uniden scanner?)

Anyone willing to share VB source code would be greatly appreciated.[/QUOTE]

The help on the MSComm control has code in the examples.
 

jbitzer

Member
Joined
Feb 17, 2006
Messages
23
Reaction score
0
Location
Cherry Hill,NJ
Al42 said:
Look at the MSComm control. The info in the help files (look at the interrupt-driven input - you don't want to poll the buffer) should get you started.

Uniden publishes their protocols, GRE doesn't. (Or is the 2052 a Uniden scanner?)

Anyone willing to share VB source code would be greatly appreciated.

The help on the MSComm control has code in the examples.[/QUOTE]

Thanks for the info. It looks like the MSComm control is for VB 6 and the version I'm using is VB 2005. There is a command My.Computer.Ports.OpenSerialPort and to receive data from the serial port you would use something like:

Function ReceiveSerialData() As String
' Receive strings from a serial port.
Dim returnStr As String = ""

Using com1 As IO.Ports.SerialPort = _
My.Computer.Ports.OpenSerialPort("COM1")
Do
Dim Incoming As String = com1.ReadLine()
If Incoming Is Nothing Then
Exit Do
Else
returnStr &= Incoming & vbCrLf
End If
Loop
End Using

Return returnStr
End Function

Sending would look something like this:

Sub SendSerialData(ByVal data As String)
' Send strings to a serial port.
Using com1 As IO.Ports.SerialPort = _
My.Computer.Ports.OpenSerialPort("COM1")
com1.WriteLine(data)
End Using
End Sub

I'm still a bit in the dark but once I understand how to send the data and then how to receive I'm sure I can pull it all together.
 

Al42

Member
Joined
Apr 29, 2005
Messages
3,457
Reaction score
0
Location
Long Island, NY, USA
Start haunting some .net web sites, looking for serial protocol programs. (2005 is dot net lite.) I haven't looked specifically for serial stuff, but there's gigs of dot net code out there. Start on www.planetsourcecode.

Sending the ddata is easy - you stuff it into the port and it comes out in the scanner. Receiving is - you wait until the control (or port, or whatever .nut uses) triggers the receive event, then your code in that event handles the input.

Advice I gave someone else - search this site - there's a program for Uniden scanners written in tcl (freeware language) that looks like a scanner. The author posted the link here a couple of months ago. (Anything to say no to .not.)
 
Status
Not open for further replies.
Top