NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass TestStand error type directly into function parameter

Hi,

I am using TestStand 4 and Labwindows CVI 8.5.

I wonder if it is possible to pass Standard Step error type into CVI function parameters.

I think it would be more simple to pass one parameter instead of passing Error code, Error occurred state and Error message into function prototype.

I tried to use tsErrorDataType struct defined into tsutil.h into my function prototype.
In TestStand, I pass Step error type into function parameter but it does not work.
TestStand displays an error meaning parameters does not match function prototype.

Thank you for your help.

0 Kudos
Message 1 of 4
(3,636 Views)

Hi Tartempion,

Into which CVI functions do you want to pass your error type ? If it is a library function, I don't think it is possible to pass only one parameter, you will always have to pass every parameters.

Regards,

0 Kudos
Message 2 of 4
(3,584 Views)
I want to use any CVI function I developped, passing directly TestStand error structure.
So, you anwered it is not possible ? The solution is to pass every error parameters, not another solution ?
0 Kudos
Message 3 of 4
(3,540 Views)
Hi Tartempion,

In order to pass the TestStand Error Container as one parameter to a function in a CVI DLL, you must use a struct that is typedef'ed and create an .fp file that is included as a type library for the DLL. When you create a .fp file to add to a DLL, the DLL will not build unless all structs/enums are typedef'ed. Thus, I wouldn't advise using the tsutil.h because you would have to go through and typedef every single struct and enum in the header file.

Instead, you can simply create a typedef'ed struct in your projects header file and create an .fp file with the struct specified as a data type. Then in TestStand, when you call the function you would need to ensure that the parameter is of Category "C Struct", and type "Error". The attached zip file contains a CVI 8.5 project that demonstrates this along with a TestStand 4.0 sequence file that demonstrates how to pass the parameter to the function by reference. In case you run into trouble creating the .fp file please refer to the following KnowledgeBase. The instructions are for enums but easily correspond to structs as well:

TestStand and LabWindows/CVI Enumeration Data Types

Hope this helps!
Manooch H.
National Instruments
0 Kudos
Message 4 of 4
(3,448 Views)