03-15-2006 04:58 AM
03-15-2006 06:07 AM
You are allocating memory into local variables DataX and DataY, but you are not freeing it afterwards. This may be upsetting CVI's internal house-keeping/tracking of allocated memory, so that when the routine is repeated it is pot luck as to whether or not the program happens to use the same memory locations as before. CVI may expect the original pointers to still be valid (ie still in the same place), as you have not explicitly freed them. By calling a different routine in the meantime this will almost certainly alter the memory area on the stack that was used to store DataX and DataY, thus corrupting CVI's internal chain. Just free the memory at the end of the FillGraphs routine and all should be well.
JR
03-15-2006 06:36 AM
03-15-2006 06:49 AM
Looks like the problem must be elsewhere, then. If you want to use the DataX and DataY variables "later" (not sure what you mean by this) then you should use static variables for them, not automatic. That way their values are guaranteed to persist outside of the function - currently the variables are discarded by CVI as soon as FillGraphs terminates; not a good idea if you need to retain their values.
JR
03-15-2006 08:47 AM
03-17-2006 08:09 AM