hello,
now i can follow the problem:
you put the file handle into your variable, but when you close it, you don't invalidate your global.
if you insert your function call "PUBLIC_NWALog();" with a 0 as a parameter:
PUBLIC_NWALog(0);
you can invalidate your global.
you can test the other way round:
if you once called the function and closed your panel, rename the file you write to.
if you call the write function again it will create the file again. this is because you have the handle still in your global variable.
hope this helps,
Robert H.
National Instruments