Error code 9 is I believe a code that will stop program execution.
But the program does not know it does not exist until you try and use it, I don't know of any way of testing wether a variable is used.
But to my mind, if you know you are going to use it in a program, then why not declare it 0 or whatever at the beginning?
You only have to do that once.
On a Galil card, even if you load another separate program and run it, the variables are stored globally, they are reset at power down.