I think you've run into a LabVIEW bug relating to the Type Cast function that has perhaps been fixed for the next release, but didn't get resolved for the 7.1.1 patch; I tried your VI in 7.1.1 on XP and saw the crash.
See the
previous thread from around Christmastime for the blow-by-blow recap of isolating the problem, reporting it to NI, and getting it onto NI R&D's plate. (Somewhere, Ben is weeping because his diagnostic work went undiscovered by Buzz! I tried a search for "memory.cpp 638" from the main Support page and found it right away.)
The good news in this situation is that you can probably work around the problem, because I don't think you actually need to use Type Cast where you use it. The String Concatenate node is smart enough to handle a VISA resource name input and implicitly cast it to a string, and it appears that this alternative approach allows the VI to avoid the problem in your case. See the attached image of a portion of your main While Loop. If you just connect the purple wire directly to String Concatenate, you should be in good shape.
Hope this works for you,
John