I'm looking for an already developed class module that wraps Visa32.dll for VB6. I haven't found one, so I've started developing my own. I'm running into a challenge that hopefully someone can help me address. When I attempt to do a read from the GPIB bus using the driver, if I don't use a fixed length string, I get a 0 length string returned. If I use
viVScanf(vi, "%t", response)
where response is a string variable, it is blank. If I set response to be fixed length of 10, I'll return the first 10 characters in the buffer, but it will stop there. If I attempt to do another read, I get a "Query Interrupted" error on my instrument.
If I use:
viRead(vi, response, ReadLength, ReturnCount)
where response is fixed length of 10 and ReadLength=10, I can do subsequent reads and look for the ASCII 10 (line feed) character in the string until it is complete.
The problem with this approach is that I'll have to loop and consume extra time reading. I'd much rather be able to dynamically set the length of the string based on the need. For example, I'd like to have a function, GPIB_Read, where I pass the length I want to return and then I can set the string to be that length prior to calling the ViRead function (or viVScanf function).
Any tips on getting past this?
Thanks,
Tom