Thanks for the reply.
I figured it out later the day I posted the message. I should've
responded to my own thread once I had the solution, but I had gotten
caught up in my programming.
I ran into another interesting issue so just in case anyone viewing this thread ever wants to know...
You can get seemingly random crashes and memory errors in labview when
using C-style strings in DLLs if you are not passing an allocated
labview string into the DLL call for the string parameter. For
example: I have a DLL function with an output parameter that passes
back a status string (using C-Style strings...unlike labview's
pascal-improved style). If you call this DLL in labview, you must
pass it a string that contains x number of characters, where x is the
string buffer size you wish to use. When you think about this
from a C point-of-view it makes sense. First you must assume that
LabView does NOT allocate any of its output parameters when using
C-sytle strings in DLLs. From there you must assume that LabView
deep-copies the internal string into the one passed in...in which case
the parameter must be allocated to some size. The crashes occured
"seemingly randomly" because LabView was copying string data to a
garbage memory address that was being passed in...sometimes this would
work alright when the memory happened to be free, but other times the
memory was already in use and a crash or memory error would occur,
corrupting the labview memory space. I would suggest writing a
utility VI/function to include in the DLL or in a string library that
takes in a numerical value for the desired length of a string, and
outputs an allocated string of that size. With this utility VI
you can easily allocate string buffers to use for catching DLL string
outputs.
~ JS
CLA, CCVID, Certified Instructor