RS232 App mod
Istha Powron
Posts: 74
It could be the stormy weather, or the fact that water· spins the opposite way in Australia as it goes down the bath drain, but I am pulling my hair out trying to get a simple VB6 comms program to work with the rs232 app mod.
The code below is part of a·GUI for a mobile robot;
Private Sub MSComm1_OnComm()
Dim sData As String ' Holds·incoming data
' If comEvReceive Event then get data and display
If MSComm1.CommEvent = comEvReceive Then
··· sData = MSComm1.Input ' Get data (9 bytes)
··· Text6.Text = "Data"
··· Comm_Flag = 1
··· Text5.Text = sData
···
End If
I know the data is comming from the robot (RS232 App Mod) as I can see it on Hyperterminal.
I know that the VB6 app can see data from the comm port as when I type to it from another pc with Hyperterminal it comes up on the GUI.
But when I connect the robot to the GUI, the VB6 program freezes. When I disconnect it, it runs again.
When I disconnect the robot, some data is visible on the GUI but it is corrupted.
My initial thought was a voltage difference between my laptop and the robot, but Hyperterminal works.
If I change the baud rate on MSComm and connect the VB6 App to the debug terminal on the BS2 on the robot, I get good data.
The only other thing that may affect anything is that the robot is running the RF app mods to communicate with another mobile robot. Maybe the RS232 app mod is picking up RF interference.
I KNOW my baud rates are all good.
Has anyone else had these problems?
Thanx
Istha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
Adam Smith
The code below is part of a·GUI for a mobile robot;
Private Sub MSComm1_OnComm()
Dim sData As String ' Holds·incoming data
' If comEvReceive Event then get data and display
If MSComm1.CommEvent = comEvReceive Then
··· sData = MSComm1.Input ' Get data (9 bytes)
··· Text6.Text = "Data"
··· Comm_Flag = 1
··· Text5.Text = sData
···
End If
I know the data is comming from the robot (RS232 App Mod) as I can see it on Hyperterminal.
I know that the VB6 app can see data from the comm port as when I type to it from another pc with Hyperterminal it comes up on the GUI.
But when I connect the robot to the GUI, the VB6 program freezes. When I disconnect it, it runs again.
When I disconnect the robot, some data is visible on the GUI but it is corrupted.
My initial thought was a voltage difference between my laptop and the robot, but Hyperterminal works.
If I change the baud rate on MSComm and connect the VB6 App to the debug terminal on the BS2 on the robot, I get good data.
The only other thing that may affect anything is that the robot is running the RF app mods to communicate with another mobile robot. Maybe the RS232 app mod is picking up RF interference.
I KNOW my baud rates are all good.
Has anyone else had these problems?
Thanx
Istha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
Adam Smith
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Try this first
main:
SEROUT TXpin,Baud,[noparse][[/noparse]"A"]
PAUSE 4000
GOTO main
If you still get nothing try this
main:
SEROUT TXpin,Baud,[noparse][[/noparse]"A",10]
PAUSE 4000
GOTO main
The contents of the Text5 should display the AScii code for "A" (65) once you are able to recieve one byte you can expand and discover where the current problem lies.
Jeff T.
But then I realised I had a spare RS232 mod and swapped them. Worked first go. DON'T you hate that.
Sorry to waste everyone's time.
Istha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
Adam Smith