NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

dll flexible prototype adapter

Hi,

I'm having problems with dll flexible prototype adapter and vxi equipment.
I inicialize a switch matrix (from Vxi-Technology) within a DLL and keep
the handler it returns me in a local variable. Then I try to use this handler
in other step that call other DLL to manage the instrument but I receive
a runtime error from the vi driver that says "invalid object or reference"
with code -1073807346.
Can anybody help me?
Thanks.
0 Kudos
Message 1 of 3
(2,743 Views)
Hi Ignacio,

I've done the same thing in the past with various hardware references. I
think your problem lies with using local variables.

Local variables will not be transferable between DLLs and additionally they
will not hold there value between DLL calls (they get reinitialized on every
call). So, what you can do is pass the hardware reference back to
TestStand, so that it can pass it to the following DLL call, or you can
define a global variable the is used in both DLLs. Global variables will
maintain there values until the DLLs are unloaded, and are accessible to all
DLLs that have defined them. You will have to do some reading concerning
declaration modifiers (ex: static int VXIRef) but this should be reletively
easy to figure out.

Hope this helps

Denis


"
IgnacioFreijeiro" wrote in message
news:3a03eae2@newsgroups.ni.com...
>
> Hi,
>
> I'm having problems with dll flexible prototype adapter and vxi equipment.
> I inicialize a switch matrix (from Vxi-Technology) within a DLL and keep
> the handler it returns me in a local variable. Then I try to use this
handler
> in other step that call other DLL to manage the instrument but I receive
> a runtime error from the vi driver that says "invalid object or reference"
> with code -1073807346.
> Can anybody help me?
> Thanks.
0 Kudos
Message 2 of 3
(2,743 Views)
I also do something very similar, I call my instruments by calling directly their dll via the DLL Flexible Prototype Adapter (hp34401a_32.dll, tktds2x0_32.dll).

I have station globals to hold the instruments handles to reference the instruments later in TestStand. This all worked fine until one day I started getting the very same error
code 0xBFFF000E" (-107387346) I am not sure what changed. If I changed something in my program or was it after a TestStand update.

I have the �open� instrument calls in my SequenceFileLoad callback saving the returned instrument handle in station globals. To fix my problem I had to add open call to PreUUT and SequenceFilePreInteractive callbacks.
0 Kudos
Message 3 of 3
(2,743 Views)