Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Implementation of Radar Velocity Sensor


schiller Oct 3, 2014 08:22 AM

Hello,

I want to measure the surface flow velocity of a torrent with a CR1000.
Therefore i have got a radar velocity sensor that is usually used for speed measurement of vehicles in traffic flow.

In a pretest i have checked if the sensor works for this kind of application, connected it via RS232 to a laptop an read out the sensor with hyperterminal (9600-8-N-1). The measuring values are sent like this in a constant string:

" ... 4.7;4.3;3.5;4.4;3.7;3.8;3.7;3.4;3.5;5.1;4.4; ... "

The test showed that the values are not sent in defined intervals. Dependent of the positioning of the sensor the intervals vary due to the mounting angle, grade of reflectivity, intensity of turbulence, etc. in a range of about 5 measurements/second in good conditions to one measurement every 2-3 seconds in suboptimal configuration.
Nevertheless i want to write the measured data every second into the data table, even if the measuring interval differs.

As i am not a very experienced programmer i don´t really know how to implement the sensor into the CR-Basic program.
Has anybody got a good idea (or even better a code snippet) of getting the sensor to work?
Thanks for any hints.


JDavis Oct 7, 2014 08:40 PM

Give this a try. The tx from the RS232 will go to C2 on the CR1000. This code will drop out a lot of the data values, but will give the most recent number that was between two semicolons.

Public Speed
Public NbytesReturned As Long
Dim tempString As String

'Main Program
BeginProg
SerialOpen (Com1,9600,0,0,50)
Scan (1,Sec,0,0)

SerialInRecord (Com1,tempString,59,0,59,NbytesReturned,01)
Speed = tempString 'converts the string to a numeric variable

NextScan
EndProg


schiller Oct 8, 2014 12:27 PM

Thanks for your reply - I'll give this a shot!

Log in or register to post/reply in the forum.