>I have got assignement from a dairy to prepare dairy automation system , i have to capture data from Fat testing machine having RS232 output port which can be connected to PC
>Whenever machine Throw Data (numeric FatReading e.g. 5.6) this data should appear on my form where operator can further add more data
>
>PLEASE HELP ME IT'S VERY URGENT,
>IS THERE ANY SITE WHERE I CAN LEARN HOW TO READ DATA FROM RS232 port
Imanali,
Basically you would use MSComm32 activex. You can find valueable information in download area. Check for serial.zip by Marc Grajover.
Below sample waits data from a GPS for 5 seconds max with strings '$GPGGA' and '$GPGSA' in it (GPS was sending data at 4800 baud) :
oComm = CREATEOBJ('MSCOMMLib.MSComm')
With oComm
.CommPort = 1
.Settings = "4800,N,8,1"
.InputLen = 1
.PortOpen = .T.
lcDATA=''
lnStart = seconds()
llDataReady = .F.
Do while seconds()-lnStart < 5
.InputLen = 1
lcDATA = lcDATA+.input
lnGGA = at('$GPGGA',lcData)
lnGSA = at('$GPGSA',lcData)
If lnGGA > 0 and lnGSA > lnGGA
llDataReady = .T.
Exit
Endif
Enddo
.PortOpen = .F.
Endwith
Release oComm
if llDataReady
? lcDATA, len(lcDATA)
else
wait window timeout 2 'GPS timedout!'
endif
Cetin