LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

call standard prototype adaptor function from application?

I have a dll with C/CVI standard prototype adaptor style functions e.g.
 
void __declspec(dllexport) TX_TEST myFunction
    (
    tTestData *testData,
    tTestError *testError
    )
{
...
}
 
that are called from TestStand (ver 2) sequence files.  How do I call these same functions from an application?  In other words how do I fill out the testData and testError structures before calling the function?  Some of the functions do use the sequence context.  
0 Kudos
Message 1 of 2
(2,772 Views)

Kevin,

 

To call your functions from an application, assuming it is another CVI application, you will want to include <TestStand>\AdapterSupport\stdtst.h in your source. This header file defines the tTestData and tTestError structure data types.

 

You may also want to refer to the C/CVI Standard Prototype Adapter section of Chapter 13 of the TestStand User Manual. Tables 13-10 and 13-11 list each field of the two data structures in question. This table includes the data type and a description of each field. It also tells whether a field is an input or output.

 

The manual is available from the Help menu of the sequence editor or from here.

 

The real trick of calling one of your functions from another application will be dealing with the sequence context. Chapter 8 of the User Manual discusses the sequence context in more detail. A viable sequence context will only be available when a sequence is being executed.

 

If the application you are building will be executing sequences, then you will be okay. If not, then you may want to consider another route instead of using the functions you have. That is, you may want to consider building a new DLL from functions that are not based on the TestStand prototypes.

 

Regards,

 

Eric M

Applications Engineer

National Instruments

0 Kudos
Message 2 of 2
(2,752 Views)