Calling a subroutine from a subroutine?


#1

Salutations!

To preface this, I’m a newcomer to the opto-world, but have ample experience coding in other procedural languages.

I’ve spent some time building a few subroutines to take care of some relatively simple tasks that i want to do for a system I’m setting up, and since I’m a big fan of reusability, i want to be able to run some of these subroutines from within other subroutines.
Is this possible? I’ve tried to call a subroutine from within another one, but the compiler fails saying that the command can not be found, even when both subs are included in my strategy.

Pretty simple question i guess, but i couldn’t find anything related by searching, so here goes.


#2

Hello!

PAC Control 9.5 and up allows nested subroutines (no recursion though). Can you post the code you are having trouble with and see if we can help?


#3

Ah, that must be it then, I just checked, and we have version R9.4e. I’ll just have to try updating.

For further reference, here is the code:

Calling Subroutine:


#4

Called Subroutine:


#5

Compiler output: