
FUNC rawbytes?

SteveMob
✭
in RobotStudio
Hello,
I am trying to build a function:
FUNC rawbytes PackCustomMessage(VAR num messageNumber,\VAR string messageString)
! Creates a custom message (error/warning/validation)
! Inputs:
! -messageNumber: num
! -optional messageString: string
! Returns:
! -message2: rawbytes
.......
RETURN message2;
ENDFUNC
I am getting an error saying rawbytes not a value type. So my question is, are there some data types (rawbytes in particular) that the "FUNC" cannot use?
Thanks for any help,
SM
I am trying to build a function:
FUNC rawbytes PackCustomMessage(VAR num messageNumber,\VAR string messageString)
! Creates a custom message (error/warning/validation)
! Inputs:
! -messageNumber: num
! -optional messageString: string
! Returns:
! -message2: rawbytes
.......
RETURN message2;
ENDFUNC
I am getting an error saying rawbytes not a value type. So my question is, are there some data types (rawbytes in particular) that the "FUNC" cannot use?
Thanks for any help,
SM
Tagged:
0
Best Answer
-
The return statement of a function can only return value types, with as exception dimensioned types (for example arrays). 'Rawbytes' are used as a general data container and can be filled with any type of data (num, byte, string, etc) by means of support instruction/functions; and is thus not a value type.
A workaround is to use a INOUT parameter and thus change the parameter instead of returning a value.5
Categories
- All Categories
- 5.5K RobotStudio
- 398 UpFeed
- 19 Tutorials
- 13 RobotApps
- 299 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 324 IRC5
- 63 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 813 RAPID Programming
- 5 AppStudio
- 3 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings