From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph function problem in DLL when called from TestStand. OK when called from CVI.

Hi,

 

I have a DLL which I wrote using CVI.

There isn't a UIR file.

When the process attaches, I call a function which;

  • Creates a panel with NewPanel().
  • Creates a number of controls including a graph with NewCtrl().
  • Traps new panel and new control errors.
  • Sets various panel and control attributes.
  • It does not display the panel.

The DLL has two functions to use the panel and it's controls.

  • A function to add plots to the graph.
  • A function that displays the panel and waits for the user to close it.

If I call these function from a CVI test application they work as intended.

 

If I call the functions from TestStand with the CVI debugger attached they work as expected.

 

If I call the functions from TestStand without CVI debugging then about 95% of the time the functions fail.

 

Failure is always at the following functions;

  • DeleteGraphPlot()
  • PlotWaveform()

The error returned by the functions is -4 which is the error code for an invalid handle.

 

To try and debug this I have written the handles to a file as part of the error trap and compared them to the handles written to another file when the panel and controls are created. They are the same and therefore should be vaild.

 

There are several other functions in the DLL which work correctly with TestStand although none of them use a panel or controls.

 

I'd be grateful for any insights.

 

John.

 

 

John C
0 Kudos
Message 1 of 1
(4,069 Views)