Checking data from serial channel

THOD
✭
Is there a way to see if there is data in the serial buffer and if there is not then continue? I have a While loop where I want to see if another piece of equipment has sent data. If it has not then I want to do some other things.
WHILE TRUE DO
szCMDResult := ReadStr(ReadData\Delim:="-");
TEST szCMDResult
CASE szTest1:
ENDTEST
!Do something else
ENDWHILE
Thanks
0
Comments
-
So this is what I have come up with. Please tell me if it is stupid and I am just missing something.I basically catch the error of a time out.WHILE TRUE DOszCMDResult := ReadStr(ReadData\Delim:="-"\Time:=2);TEST szCMDResultCASE szTest1:ENDTEST!Do something elseENDWHILE......IF ERRNO = ERR_DEV_MAXTIME THENTRYNEXT;ENDIFAny thoughts?0
Categories
- All Categories
- 5.6K RobotStudio
- 401 UpFeed
- 21 Tutorials
- 15 RobotApps
- 304 PowerPacs
- 407 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 354 IRC5
- 74 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 850 RAPID Programming
- 26 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 110 Collaborative Robots
- 5 Job listings