AnsweredAssumed Answered

WriteIEEEBlock/WriteString help

Question asked by JPorem on Jan 26, 2010
Latest reply on Jan 26, 2010 by JPorem
Hello,

I am not sure if this question is even answerable, but I am in a bit of a conundrum and I don't have a good way out. I am programming a completely automated testbed for a customer and the "PutState" currently implemented by the IVI drivers does not work (I have submitted a bug report already).

Instead I have to send direct commands to the insturment from my C# environment. The problem is I have two options, neither of which work.

I can send the command out via WriteString, but the byte array I get back from the "GetState" contains 0x00 bytes... so when I do an ASCII encode it becomes a null character, which the instrument interprets as "End of String."

On the other hand I can use WriteIEEEBlock, but that doesn't seem to work properly. When I monitor it NI-GPIB side it appears as though WriteIEEEBlock is sending the state data correctly, but it is appending a size-of-input on the front "#4xxxxx." The instrument seems to have no idea what to do with this, but that is the only problem with this. (I manually entered in the state without the #4xxxx at the front with the same command it and works).

Is there anyway I can either use WriteIEEEBlock but prevent it from sending the "size-of-input" out front or use WriteString, but use whatever encoder the Agilent/GPIB is using (since it doesn't seem to output null characters on the buffer when it encodes it for me)  

Outcomes