LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I fix an "INVALID_REFNUM" error from DDE check?

I'm controlling a power meter with LabView using DDE. When I try to read the power with DDE advise check, I get an "INVALID_REFNUM" error. The refnum looks like a random 8 digit number. It comes from a DDE advise open icon, which takes a conversation refnum and outputs an advise refnum. The advise refnum is then wired through a shift register to go into DDE advise check. I have ensured that the number cooming out of DDE advise open is the same one that goes into DDE advise check. What can I do to fix this error?
0 Kudos
Message 1 of 3
(3,121 Views)
There could be several problems here. First and foremost, the DDE driver might be hosed or might be buggy. Is there any particular reason you're using DDE to talk to an instrument? If the device uses a standard interface (serial, gpib, ethernet etc) it would probibly be easier--and more robust--to write the drivers yourself.

Second, are you trapping errors coming from the DDE Open function. If not you might be getting an error and don't know it.

Third, there might be some other related logic that is causing the problem and is pointing you in the wrong direction. Try writing a very simple VI consisting of an open, the check and a close. Nothing else, strip out all the extraneous logic or code. See if that works.

Another way of testing the DDE is to try c
alling it from a different environment such as Excel.

Hope this help...

Mike...

"...after all, He's not a tame lion..."

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(3,121 Views)
Hi Mike,

I'm having a DDE problem that sounds related to sawitri's. I have an application which opens a DDE conversation, executes a few commands, then closes it. This works fine. However, when I open the conversation and then try to execute commands individually (running sub-vi's by hand), I get the invalid refnum error. It is as if Labview closes the conversation automatically once the vi's leave run mode, so that the conversation refnum is no longer valid despite the fact that I have not closed it explicitly. Is this true? In this case I can just open a new conversation every time I run the vi and not worry about making sure that it's closed later.

Chris
0 Kudos
Message 3 of 3
(3,121 Views)