Ssc32 read input with visual basic

HI,
First sorry for my bad english. :blush:

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.

I don’t know anything about VB, but what sonar sensor do you have. I have never heard of one with analog voltage output.

It’s a Max sonar EZ1

3 output :

serial, analog and pulse width

maxbotix.com/MaxSonar-EZ1__FAQ.html#How_does_the_signal_system_in_the_MaxSonar_EZ1_work

Ah we need to stock those. :smiley:

They do seem pretty well thought out for the price.

But…but…but…you need TWO of them to get that “wide-eyed robot” look! :open_mouth:

:wink:

Unless someone wants a Cyclops look

Ah ha ha ha ha… :laughing:

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. :slight_smile:

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.