03-14-2008 03:26 AM
03-14-2008 04:40 AM
Hi Raybie,
you may be runningo into problems with too long strings due to how the instrument reads them. As you can see in the online help for Ini_PutString:
If the string is very long, the instrument driver will split it across multiple lines associated with the same tag name. This is done by generating new tag names, such as in:
<Tag Name> Line 0001 = "first part of line ........"
<Tag Name> Line 0002 = "second part of line ......."
<Tag Name> Line 0003 = "third part of line"
When you attempt to retrieve the string from the file by calling Ini_GetPointerToString, Ini_GetStringCopy, or Ini_GetStringIntoBuffer, you only need to enter the same Tag Name that you passed into this function. The instrument driver takes care of reconstructing the original single string from the multiple lines.
So the question is: how is your text written to the ini file? In my experience writing a string 512 bytes long using PutString and reading it back with GetStringIntoBuffer is safe, so if you are writing your text with another tool you may consider splitting it in multiple lines formatted as shown above. Reading it back with inifile instrument should be successful. You may also want to dig into the source code, but I must warn you that this is NOT a trivial task!