RAPID: Use signal as parameter in a procedure

The RAPID reference manual states about signalxx type: “The data type can, on the other hand, be used as a parameter when declaring a routine.”

I have a routine that uses a signalgo as an input parameter, but RobotStudio throws an error when I check the program.
Am I doing something wrong or is what I’m trying to do not possible?

What is the error?

Maybe we can help to you when we see error code

Was it “signalgo not value type”?

I’ve had the same issues. I finally got around it (probably not the most efficient way) by doing a test of the GI:
TEST GInputDnum(giProgramNum)
CASE 1:
rFD4_Blade1;
CASE 2:
rFD4_Blade2;
CASE 3:
rFD4_Blade3;

ENDTEST

In my case I was calling routines directly as a result of the test, but I would imagine you could assign a value to a num data type, then use that num as an input parameter. Of course, that would be difficult and a lot of code if you have a large range of possible GI values, but it worked for me in my situation.

-Bria

Hi,

if you use a signal as parameter for a routine, you have to user the argument “VAR” before the datatype in the routine header.

Example:

PROC TestSignal(VAR signalgo signal)

setgo signal,2;

ENDPROC

Regards

Micky