How to make Picaxe interface via VB

Hi,

I want to make a interface to my picaxe.
I have Microsoft Visual Basic 2008 Express Edition and NetCommOCX.

Does anyone have any working code snippets to help?

My Basic:

main:
SERTXD ("Hello")
pause 500
goto main

My Visual Basic (derived from Tarzan's):

Private Sub NETComm1_OnComm(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NETComm1.OnComm
With NETComm1
.CommPort = 4
.DTREnable = True
.Handshaking = 0
.InputLen = 0
.NullDiscard = True
.RThreshold = 1
.RTSEnable = True
.set_Settings(2400, N, 8, 1)
.SThreshold = 1
End With
Dim rData As String
If NETComm1.CommEvent = comEvReceive Then 'If comEvReceive Event then get data and display
rData = NETComm1.InputData
TextBox1.Text = CStr(rData)
End If
End Sub
End Class

I have bolded and coloured red the errors.

I am unsure on how to fix them.

I am using VB.Net 2008
 
Last edited:

jppizhere

New Member
How about some quotes for the first one?

set_Settings("2400,N,8,1")

And for the second are you maybe trying for this?

If NETComm1.CommEvent = NETComm_EV_RECEIVE Then

Not sure on that second one, I have not personally tried it as I use MSComm1 for serial comms, and generally it is from pc to picaxe. If I happen to need to echo something back to pc or receive data, I just let it go into input buffer and the use it when needed.
 
Last edited:

Denzel

Senior Member
...

There is literally a thread on this each week with someone wanting to to interface a picaxe with vb. Do a forum search and you should have enough information to do anything you require.
However if it is two way communication you require this is a little more complicated...
 
Top