HI,
First sorry for my bad english.
I’m connected a us sonar to the " A " input of the ssc32.
this sonar send to the A pin, an analog voltage according to
the distance.
With the prog : Lynx ssc32 terminal , the measure is fine when i’m
reading the A input. it work right.
but,
I want to read the value with Visual basic
I send :
MSComm1.Output = “VA” + Chr$(13)
But i don’t know how to read a correct value.
MSComm1.input return some value, but i don’t konw how to
extract a usable value.
Thanks you for your help.
oscar30340:
HI,
First sorry for my bad english.
I’m connected a us sonar to the " A " input of the ssc32.
this sonar send to the A pin, an analog voltage according to
the distance.
I don’t know anything about VB, but what sonar sensor do you have. I have never heard of one with analog voltage output.
Ah we need to stock those.
eddieb
November 16, 2007, 6:00pm
5
They do seem pretty well thought out for the price.
seamus
November 16, 2007, 6:10pm
6
But…but…but…you need TWO of them to get that “wide-eyed robot” look!
sn96
November 16, 2007, 6:15pm
7
Unless someone wants a Cyclops look
Ah ha ha ha ha…
oscar30340:
I want to read the value with Visual basic
I send :
MSComm1.Output = “VA” + Chr$(13)
But i don’t know how to read a correct value.
MSComm1.input return some value, but i don’t konw how to
extract a usable value.
Unfortunately I don’t know if this link will help at all… But hopefully there will be some useful information here somewhere!
search.msdn.microsoft.com/search … ery=mscomm
It’s ok,
i find the soluce. if anyone want it,
ask me the code.
Thanks you for your help
It’s always good to post your solutions when you get them. Others may be looking to do exactly what you have already done.
8-Dale
Here the code :
First you send to ssc-32 a request : Ex: for A input :
MSComm1.Output = “VA” + Chr$(13)
and wait for receive …
Private Sub MSComm1_OnComm()
Dim sData As String
Dim valeur As Long
If MSComm1.CommEvent = comEvReceive Then
sData = MSComm1.Input
valeur = (CStr(Asc(sData))) * (5/256)
End If
End Sub
“*(5/256)” is for convert the value to a voltage.