Hi Jerry,
I don't know of a specific reason why this may happen..but the first step would be to try and narrow this down...
Do you have any casts in your code ?
Especially from string to double? (from data you are getting back perhaps ?)
Its possible that if there is a timing issue, then sometimes you may get invalid , or unexpected data back, so if you have a cast such as dblValue = Cdbl(strText) * 2 it may work most of the times, but fail, if strText is not a number in the unexpected case...
The other case could be that, it is a Gpib Write or a Gpib Command thats failing with the type mismatch error(The command itself will not take place if there is a type mismatch error - so NI-Spy will look fine...). This could be true in the case, where data you send out is
not a string literal, and something that you calculate in your code..
The Read should always work, since it returns a variant..
So those are two places you could look at for potential problems...i.e. (1) the GPIB Writes,especially those where the command is not a literal string and (2) any casts, or a combination of the two...
Hope this helps some...
Nandan Dharwadker
Staff Software Engineer
Measurement Studio Hardware Team