Checking data from serial channel
Options

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
- 399 UpFeed
- 20 Tutorials
- 14 RobotApps
- 301 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 345 IRC5
- 73 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 843 RAPID Programming
- 20 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings