I'm using callin to get global values.
Here's a simple function to get string value from global and return it:
The InterSystems Callout Gateway allows InterSystems Data Platform applications to invoke shell or operating system commands, run external programs in spawned processes, and call functions from specially written shared libraries.