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.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 801 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings