02-20-2009 01:42 PM
Hi,
I have a CVI struct that contains an enumerated type. I want to call a CVI function with this struct as an argument from TestStand. I created a similar struct (container type) in TestStand, and the other fields in the struct seem to be passed to CVI from TestStand ok, but the enum field is always zero. Any idea what I can do? I don't want to change the CVI enum and struct definitions.
Example:
typedef enum eOption {OPTION_A = 0, OPTION_B = 1} Option;
typedef struct stMyStruct {
double a;
int b;
Option c;
} MyStruct;
Thanks!
Solved! Go to Solution.
02-23-2009 07:00 PM
Are you using a dll? Assuming so, my thoughts follow:
Which versions fo CVI and TestStand do you have? Have you created an fp file for the functions that you're exporting in your dll? The problem you're experiencing may have something to do with the behavior that's explained in this Knowledge Base article:
TestStand and LabWindows/CVI Enumeration Data Types
Please follow that Knowledge Base article to create an fp file for your dll. Let us know if that works.
02-24-2009 08:39 AM
As it turns out, my TestStand container type definition didn't exactly match the CVI struct, in terms of memory sizes of the fields. Once I fixed the TestStand container defintion to make the memory packing exactly match my CVI struct, the enum field was passed just fine (I defined the enum field as a signed 32-bit integer in the TestStand container properties). I didn't need to create an fp or a type library for my CVI dll.
Thanks!