Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

today i get yesterday's data. tomorrow I'll get today's?

Dear group,
I have the following weird problem: I have instruments A, B, C, etc. on
the GPIB bus. When I try to read data from one of them, I receive the
data from the instrument that I interrogated last time. If it's a first
read during the GPIB session, I don't receive anything (actually,
garbage, or a string of linefeeds). If I ask same instrument one more
time immediately, I get right data. That is:
I access instruments A|B|C|A|A|C|A|B|C|A|B|C|A|B|C|
I get data from ?|A|B|C|A|A|C|A|B|C|A|B|C|A|B|

it happens also when I step through my program, so it's not because I
take data too fast. Nevermind the subject, I don't ask one instrument a
day

What is going on?
May be somebody saw this or similar prob
lem before and could help me
figure it out.

My system: PentiumIII-500 (overclocked to 560)
Win98
AT-GPIB card (it's old, I know, but still good)
Various Lock-in amplifiers, digital multimeters, a frequency
synthesizer are hooked up to the bus.
The controlling program is in VB.

Thanks in advance

Yuri.
0 Kudos
Message 1 of 8
(3,805 Views)
Sorry, I forgot to mention that if I ask for different kind of data
from the same instrument, I still receive the data I asked last time
for.

Yuri
0 Kudos
Message 2 of 8
(3,805 Views)
I am not sure I understand the question. You usually have to write to an instrument to receive data from it. In which case an initial read would return an invalid response (usually it would time out, but some older instruments may have other behaviors). Therefore if your algorithm were backwards and you read before you wrote, you would see this exact behavior (the first access would be a read of a timeout or garbage, the second access which does a read before the write would return the response from the first instrument, ...).

Just a thought. If you wish to post your algorithm for reading and writing it would help others on the message board.
0 Kudos
Message 3 of 8
(3,805 Views)
Right, but all my instruments would cause timeout if they don't have any
data ready to be sent. And besides, if I was reading one instrument
without sending it a request first, I can't see how I would receive the
data from the instrument I talked to just before.

Yes, I first ask instrument to send me certain data, like call
IBWRT(lockin, "OUTP? 1") would be to ask one of my lock-ins to report X
channel reading. then I do

buffer=space(40) 'to have an empty string to read into
call ibrd(lockin, buffer)

That's all of the algorithm. this program worked like a charm until I
replaced one lockin in the system and had to make minor changes in the
code.

Also lights on all my devices indicate that I am addressing right
instruments each time, but the data I r
eceive clearly come from one
request ago.

in IBIC I don't have this problem.

I am banging my head on the wall..

Yuri

GPIB Guru wrote:
>
> I am not sure I understand the question. You usually have to write to
> an instrument to receive data from it. In which case an initial read
> would return an invalid response (usually it would time out, but some
> older instruments may have other behaviors). Therefore if your
> algorithm were backwards and you read before you wrote, you would see
> this exact behavior (the first access would be a read of a timeout or
> garbage, the second access which does a read before the write would
> return the response from the first instrument, ...).
>
> Just a thought. If you wish to post your algorithm for reading and
> writing it would help others on the message board.
0 Kudos
Message 4 of 8
(3,805 Views)
Why don't you run NI-Spy in the background for your VB session. That may provide some valuable insight. It would also be nice to run NI-Spy for an ibic session. If this does not shed any light to you, attach the two spy captures I can take a look at them.
0 Kudos
Message 6 of 8
(3,805 Views)
It sounds like the program is somehow using the session at the wrong time. Re-verify that the proper unit descriptors or session handles are being used for each call. If further assistance is necessary, please include an NI-Spy capture.

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 5 of 8
(3,805 Views)
Randy and Guru,

Thank you for your replies. I use AT-GPIB(not TNT) in my win 98 box with
compatibility release. Unfortunately this makes GPIB spy unusable. I
want to try reinstall all GPIB hardware and software, but right now I
can't see how I uninstall all the software that i have right now. There
are no NI entries in Control panel|system|Device Manager or Control
Panel|Add/Remove Programs. Should I just delete all the appropriate
files?

What is session handle? Never had to worry about those..
Thank you.
Yuri

Randy Solomonson wrote:
>
> It sounds like the program is somehow using the session at the wrong
> time. Re-verify that the proper unit descriptors or session handles
> are being used for each call. If further assistance is necessary,
> plea
se include an NI-Spy capture.
>
> Randy Solomonson
> Application Engineer
> National Instruments
0 Kudos
Message 7 of 8
(3,805 Views)
Okay, I think I solved the problem by just replacing interface card. I
had another one around. Still interesting, what was it..
thanks for the help
Yuri
0 Kudos
Message 8 of 8
(3,805 Views)