LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Null ActiveX refnum problem

I have three differant ActiveX controls, all three together represent one peice of hardware. The system we are using supports upto twelve peices of hardware connected to the same computer.

Initially I placed three ActiveX object controls in one VI and used that sub-vi 12 times on the parent vi. I found that 12 sub-vi's on the same vi use the same instance so I created twelve differant vi files (each identical appart from the fact they are differant files on the hard disk) and used those to make sure there are differant instances of the ActiveX objects within the program.

I have one loop that is run to initialise the ActiveX objcets, this gets the Refnum from the 12 unique sub-vi's and places them in to an array. It then passes this array
into another Vi to do the setup procedures, this works fine.

after initialisation is over with I want to get down to the real work, the first loop I've written to do something uses the array that was built up in the initialisation stages (before this loop runs of course). The error I am getting is code 93 (I think!), "ActiveX Object refnum is null" (or something similar).

I have tried storing the refnums in, a global, a local (to the top level/parent vi) and an array control on the parent vi. All three continue to give me null in the second stage of the program I wish to run.

I realise this is a bit complex and is probably caused by the design of my program, if you need any more details feel free to ask. Due to it being a commercial peice of software I cant post the code though.

Any general tips on avoiding null ActiveX object refnums would also be helpfull.

Thanks

TMC
0 Kudos
Message 1 of 2
(2,754 Views)
Hi TMC,

Can you post a non-proprietary example that demonstrates the problem?

If not I can only guess.

I have seen refnums go invalid when a VI stops. An example of this would be an action engine that gets refnums and puts them in shift registers. In the case of numerics etc, the data will stay in the shift register as long as the VI is open. In the case of refnums, the go in-valid.

That is all I can offer for now.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(2,754 Views)