How to solve Error trying to use cameradev as a parameter
XNOR
✭
RobotWare 6.09.02.00:
So I'm trying to use cameradev as a parameter in a routine. Per the datatype details:
So I'm trying to use cameradev as a parameter in a routine. Per the datatype details:
>>
Data of the type cameradev must not be defined in the program. However, if it is then an error message will be displayed as soon as an instruction or function that refers to this cameradev is executed. The data type can, on the other hand, be used as a parameter when declaring a routine.
>>
Obviously there are plenty of built in routines and functions that use cameradev as a parameter already.
So what happens is I'm trying to use as follows:
PROC rLoadVisionProg(cameradev CamName ,string ProgName)
...
ENDPROC
And I'll get a semantic error: Type error(83): cameradev not value type
Tagged:
0
Best Answer
-
Digging deep into the Kernal manual I found the solution in the 'DATA TYPE VALUE CLASSES' section. There is a table that shows 'Possible and impossible combinations of object usage and type value class'. It indicated for parameters of type Non-value or semi-value you need to prefix with a VAR declaration.
So this worked when I added VAR in front:
PROC rLoadVisionProg(VAR cameradev CamName, string ProgName)
1
Answers
-
It might be the case that they use it as a switch parameter.
The special type, switch, may (only) be assigned to optional parameters and provides a means to use switch arguments, that is arguments that are only specified by names (not values).
Lee Justice0 -
Good job, thanks for sharing.Lee Justice0
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)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings