07-22-2005 07:41 AM
07-24-2005 12:24 PM
If the
Exception is thrown I can call the property
ieeeDevice.LastCont
that shows me a '6'. So the data are read but I cannot access it because the
Exception it thrown before the data are passed to my String. I think in the C
library where I call ibrd(...) directly with a pointer on my buffer the buffer
is filled and I can read the 6 characters at least.
Wouldn't it make sense to add an other method to the C# library where I can
pass a StringBuilder object to the ReadString() method and the n character
which are read before the timeout would be appended to the StringBuilder before
the Exception is thrown?
07-25-2005 09:16 AM - edited 07-25-2005 09:16 AM
Message Edited by ScottieB on 07-25-2005 09:18 AM
07-25-2005 09:34 AM
Hi Scott,
thanks for your reply.
I set up the device to listen for both, the EOI line and a '\n' character also. This works most of the time, but sometimes the read operation stopped and a TIMO error is reported. The strange thing is: If this error happens the read stops always before the '\n'. The next read operation will read the missing '\n' character.
Is it possible the other device sets the EOI line to early? So my device stops the read after the '\r' and miss the '\n' because the EOI line is already set. And since my device know there are one character missing it throws an error. (Just an idea...)
What do you think?
07-25-2005 10:49 AM
07-26-2005 10:52 AM
Just to be clear, I understand that you're getting EABO with a Timeout error on your GPIB reads from a certain device using the .NET Language Interface.
This still seems like something is going on with your setup. Let me explain how a read is normally terminated.
(EOI Asserted) OR (Timeout Reached) OR (Byte count reached)
That's the expression used to terminate a read. In addition, if you're setting EndOfStringCharacter and TerminateReadOnEndOfString, another input is added to the OR:
(EOI Asserted) OR (Timeout Reached) OR (Byte count reached) OR (Termination Character found)
You're getting a timeout error, so that means that however long your timeout is, that period of time is elapsing before (EOI Asserted) OR (Byte count reached) OR (Termination Character found). So what I'm deducing is that your instrument takes a really long time to send its string, and the \n doesn't make it in time. This is really odd and doesn't make any sense. It doesn't sound like your instrument is asserting EOI early because if it did, then you wouldn't see a timeout (because EOI assertion would end the read).
It's possible that your instrument isn't fully complying to IEEE 488.1, but let's hope not. If you can get an ni-spy capture of the failure, it may shed some light on the issue for us.
Scott B.
GPIB Software
National Instruments
07-26-2005 11:54 AM
07-26-2005 11:55 AM
07-26-2005 11:56 AM
07-26-2005 01:54 PM
What is your timeout setting for this device? And what C# code are you using to set this timeout? It seem like it's pretty low judging by your spy captures. Perhaps your device really isn't able to respond that quickly?
Scott B.
GPIB Software
National Instruments