Dim strData as string Dim strDataComplete as string strDataComplete = "" Do While True ' Loop until serial port is read Sleep 1000 lngStatus = CommRead(intPortID, strData, 100000) 'For 100000 is the max data length you want read, change to suite Sleep 1000 If lngStatus = 0 Then 'Keep polling to see if serial has data ElseIf lngStatus <> 0 Then strDataComplete = strData 'Put data pulled from serial port here End If If lngStatus = 0 And strDataComplete <> "" Then Exit Do ' Exit loop when all data is read End If Loop
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
An Experts Exchange subscription includes unlimited access to online courses.Get Started
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE