My company is selling a device which has a computer running Windows NT and has NI-Device 1.1 installed to receive and send GPIB messages. My software is set up so that if a BIASCLKMSGS command comes in, the following commands recognized must be a set of commands for biases and clocks. After a PATMSGS, the following commands must be a set of commands for our pattern generator. In particular, after BIASCLKMSGS, a STATUS command followed by a read returns
OFFLINE
NO ERROR
or something to that effect. After PATMSGS, a STATUS command followed by a read returns
ERROR-xx
where xx is the number of the error.
We have a customer with a problem that I'm unable to duplicate at work. On occasion, they will send a PATMSGS command, then STATUS, and get OFFLINE\r\nNOERROR. This response is inappropriate, of course. The next time they do a STATUS, they get the appropriate return: ERROR-00. I believe it only happens if they had previously sent a BIASCLKMSGS followed by a STATUS. I asked him to run a debug dll that I had sent to him, which automatically made a file showing what was going on in my code. As I understand it, everytime the controlling machine sends a read, ResponseMsgRequestedCallback() should be called in my code. However it appeared that there was no call to RMRC for the first read, the one that returned the inappropriate response. Is it possible that NI-Device would return what was in the response queue, if my code was still busy processing the STATUS command? To test this, I asked him to put in a delay between the first STATUS write and the read. He replied that it didn't work, though didn't go into any details.
To attempt to duplicate his problem, I made a loop of NI-488 functions that included the above commands, trying to be as similar to his code as possible. I set it up so that if the return from the STATUS command after PATMSGS was anything other than ERROR=00, the loop would stop with a message box. The loop ran one million times without stopping.
There are a few differences between my setup and his. He is using BASIC code on his controlling machine that uses a 1997 gpib.dll. I use gpib-32.dll with Visual C++. Would that make any difference? I don't know where I can get the gpib.h and gpib.lib files I would need to use the old gpib.dll with a program built in Visual C++. Perhaps I could duplicate the problem if I used the old gpib.dll on my controlling machine. Another difference is that he talks to many devices, I just talk to our device.
Any advice on how to tackle this problem would be greatly appreciated.
Gary Fletcher