Re: Why doesn't this code work for all data types?
This is a bug in the ROBOTC compiler that applies when matching function parameters against calling code. The bug only applies when passing 'struct' as a parameter. There was an compiler variable that was uninitialized for this case. The fix will appear in the next release of ROBOTC.
There is an alternative that you should / could use to pass array arguments to functions. Use a typedef to declare the array, but not a struct. Modification of your sample is below. I also changed XgridSize to 50 because 100 seems to exceed the limit of total allocated variables.