Discussion:
Pass TestStand error type directly into function parameter
(too old to reply)
Tartempion
2008-07-02 10:10:16 UTC
Permalink
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.
Maxime MULLER
2008-07-09 09:10:12 UTC
Permalink
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,
Tartempion
2008-07-17 12:10:14 UTC
Permalink
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 ?
Manooch_H
2008-08-09 20:40:10 UTC
Permalink
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:<a href="http://digital.ni.com/public.nsf/allkb/226759075AE83ADF862571E0006D2DB3?OpenDocument" target="_blank"> TestStand and LabWindows/CVI Enumeration Data Types</a> Hope this helps!


PassTSError.zip:
http://forums.ni.com/attachments/ni/330/20834/1/PassTSError.zip

Loading...