VXI and VME

cancel
Showing results for 
Search instead for 
Did you mean: 

[NIVISA] viFindRsrc() needs about 10 secs on a VXIpc-870

In the debugger of MS-Visual C++ 6.0 you can observe that viFindRsrc() throws
hundreds of first chance exceptions caused by access violations.
The resource strings , viFindRsrc() and viFindNext() return, seem to be
correct.

Environment: Win NT4.0 SP6, NIVXI2.1.1,NIVISA2.0.1

Does anyone know a solution?
0 Kudos
Message 1 of 4
(7,853 Views)
Can you see all of your VISA Resources when you open VISA Interactive Control (VISAIC)?

Do you see this same behavior with NI-VXI 3 and NI-VISA 2.5?

I am not very familiar with the Visual C++ debugger, but the viFindRsrc() function looks on various buses for resources. It is possible that the exceptions are caused by it not finding resources in certain locations.
0 Kudos
Message 2 of 4
(7,853 Views)
I don't have a solution. I have the same problem like you with the same development environment except I am talk a GPIB card. Like you said, the data returned from
viFindRsrc is correct. When 'access violation' execption is threw in VC++, it means that some memory is touched which supposed not to. I think there is some problem in NIVISA 2.0.1. I search the entire site to see if there is a solution, but without any luck. However, I found this email that indicates that I'm not the only one that encountered this problem. Did you get any help from NI since you posted the question?

Let me know if you did! Thanks.
0 Kudos
Message 3 of 4
(7,853 Views)
Hi,

Some weeks ago, Art Boyne from Agilent technologies gave me
a good explanation for this behaviour:

"The 8 seconds is due to the need to poll the GPIB interface for all
possible addresses. Since the IEEE-488 specification does not specify
a maximum time for a device to respond, VISA must wait an arbitrary
time to determine whether the device is present. With 31 possible
primary addresses, (and for each device actually present, VISA must
also check the 31 possible secondary addresses), this takes a fairly
long time... For comparison, Agilent's VISA takes up to 30 seconds
to poll the GPIB interface.

If *no* devices are connected to the GPIB interface, then VISA can
detect this quickly, and the viFindRsrc time is very short - you can
see this by disconnecting the GPIB cable on the E9850/51.

It is possible that newer versions of NI VISA decreased the timeout
for polling each device, thereby reducing the total time, but this
increases the risk of missing a slow device.

In addition, the need to poll the VXI backplane also takes time.
The time depends on the number of VXI devices installed (more devices,
shorter time since fewer bus errors are generated by the VXI bus timeout
timer) and on the setting for the bus timeout, which can be changed
using T&M Explorer. The default timeout is 500 uS, which means the
poll takes ~128 mS. Long timeout values (the maximum is 256 mS) means
this portion of the polling will take proportionately longer.

The 250 exceptions are probably due the VXI backplane polling. There
are 255 possible logical addresses and, for each unused logical address,
a VXI bus error is generated. I believe that these bus errors are the
cause of the "first-chance" exceptions, but I will need to verify this
with NI. I should be able to get back to you about this in the next
day or two, depending on how long it takes NI to provide an answer."

So far Art�s explanation.

In NiVXI/VISA 3.2 exceptions lo longer occur in the VC++ debug window,
because the implementatinon of viFindRsrc() has been changed.
But be aware if you should have the need to run NiVISA on Agilent VXI
controllers.
Agilents version of the VXIpc870 (E9850A) is only supported with NiVXI/VISA
2.05.
So best seems to ignore the debuggers output in this case 😉

I hope this information was useful for you
Best wishes
--
Achim Lott
MICRONAS GmbH, Germany

"Cookie" schrieb im Newsbeitrag
news:506500000005000000F1540000-1007855737000@exchange.ni.com...
> I don't have a solution. I have the same problem like you with the
> same development environment except I am talk a GPIB card. Like you
> said, the data returned from
> viFindRsrc is correct. When 'access violation' execption is threw in
> VC++, it means that some memory is touched which supposed not to. I
> think there is some problem in NIVISA 2.0.1. I search the entire site
> to see if there is a solution, but without any luck. However, I found
> this email that indicates that I'm not the only one that encountered
> this problem. Did you get any help from NI since you posted the
> question?
>
> Let me know if you did! Thanks.
0 Kudos
Message 4 of 4
(7,853 Views)